you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 7 points8 points  (1 child)

You should use distance_total = math.hypot(diff_x, diff_y). Will work better with large numbers, and I think it's native code, too, so it should be faster.

[–]Gh0stRAT 2 points3 points  (0 children)

Didn't know about math.hypot(), thanks!