Commit 894c842e authored by ronan's avatar ronan
Browse files

BreakPoint corrigé

parent 54fea7b4
......@@ -63,7 +63,7 @@ class Fortune:
ly_2 = ly*ly;
# First part
h = x1_2 + y1_2 + ly_2
h = x1_2 + y1_2 - ly_2
e = 2*(y1 - ly)
# Second Part
......@@ -74,12 +74,12 @@ class Fortune:
d = (a - 2*((x1*b)/e))
f = (((h*b)/e) + c)
delta = -(d*d - 4*b/e*f)
delta = (d*d - 4*b*f/e)
x = 0
y = 0
print(delta)
assert(delta >= 0)
if delta > 0.00001:
assert(delta >= 0), "Ca a crashé " + str(delta)
if delta < 0.00001:
x = -d/(2*b/e)
y = (x*x - 2*x1*x + h)/e
else:
......
......@@ -144,16 +144,6 @@ if __name__ == "__main__":
#canvas.bind("<Key>", clavier)
ly = 100
f = Fortune(vec)
p = [f.sites[4], f.sites[5]]
for i in p:
i.point.draw(canvas)
draw_Pol(canvas, i.point, ly)
a = f.computeBreakPoint(p[0], p[1], ly)
a.draw(canvas)
print(a)
canvas.create_line(0, ly, 500, ly)
canvas.pack()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment