fixup! fixup! first commit

This commit is contained in:
Debucquoy Anthony 2022-09-30 11:49:26 +02:00
parent a5221b52a5
commit b9471f779e
Signed by: tonitch
GPG Key ID: A78D6421F083D42E
2 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
from math import floor
def transform_mp_to_abc(m, p):
"""transforme une équation de la forme y = mx + p to ax + by = c
@ -105,7 +107,7 @@ def symetrie_orthogonale(d, p):
x, y = p
ap, bp, cp = droite_normale(d,p) # perpendiculaire passant par le point
xi, yi = intersection((a,b,c), (ap, bp, cp))
return xi, yi
return round((2*xi - x)*10)/10, round((2*yi - y)*10)/10
def distance_droite_point(d, p):
"""TODO: Docstring for distance_droite_point.

View File

@ -27,7 +27,7 @@ def tests():
test(droite_normale, (-0.5, 1, 1.0), (3, 4), (2.0, 1, 10.0))
test(symetrie_orthogonale, (-0.5, 1, 1.0), (-2, 0), (-2.0, 0.0))
test(symetrie_orthogonale, (-0.5, 1, 1.0), (3, 4), (2.0, 1, 10.0))
test(symetrie_orthogonale, (-0.5, 1, 1.0), (3, 4), (4.2, 1.6))
test(distance_droite_point, (-0.5, 1, 1.0), (-2, 0), 0.0)