File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -301,15 +301,21 @@ def turn_left(heading):
301301
302302def distance (a , b ):
303303 "The distance between two (x, y) points."
304- return math .hypot ((a .x - b .x ), (a .y - b .y ))
304+ ax , ay = a
305+ bx , by = b
306+ return math .hypot ((ax - bx ), (ay - by ))
305307
306308def distance_squared (a , b ):
307309 "The distance between two (x, y) points."
308- return (a .x - b .x )** 2 + (a .y - b .y )** 2
310+ ax , ay = a
311+ bx , by = b
312+ return (ax - bx )** 2 + (ay - by )** 2
309313
310314def distance2 (a , b ):
311315 "The square of the distance between two (x, y) points."
312- return distance_squared (a , b )
316+ ax , ay = a
317+ bx , by = b
318+ return (ax - bx )** 2 + (ay - by )** 2
313319
314320def vector_clip (vector , lowest , highest ):
315321 """Return vector, except if any element is less than the corresponding
You can’t perform that action at this time.
0 commit comments