Spaces:
Build error
Build error
File size: 868 Bytes
3535d8a bee5310 250615b 65c63f5 250615b 8f7b642 bee5310 250615b bee5310 250615b bee5310 07cbfeb bee5310 8534701 bee5310 8534701 bee5310 8534701 3535d8a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | import gradio as gr
from helper import *
from main import is_intersecting
def result(l1,l2):
if is_intersecting(l1,l2):
return f"The lines are intersecting"
else:
return f"The lines are not intersecting"
def pack(x1, y1, x2, y2, x3, y3, x4, y4):
p1 = Point()
p2 = Point()
p1.make_point(x1, y1)
p2.make_point(x2, y2)
l1 = Line()
l1.make_line(p1,p2)
p3 = Point()
p4 = Point()
p3.make_point(x3, y3)
p4.make_point(x4, y4)
l2 = Line()
l2.make_line(p3,p4)
return result(l1,l2)
demo = gr.Interface(
fn=pack,
inputs=[
gr.Number(label="x1"), gr.Number(label="y1"),
gr.Number(label="x2"), gr.Number(label="y2"),
gr.Number(label="x3"), gr.Number(label="y3"),
gr.Number(label="x4"), gr.Number(label="y4")
],
outputs="text"
)
demo.launch()
|