06
Feb
08

Distance Between two Points

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

This is one of the most useful formulas that I use. This formula measures the distance between any 2 given points…

These points can be coordinates, movie clips, mouse position, ect…

Full code after the jump.

dx = x2 – x1;
dy = y2- y1;
Dist = Math.sqrt(dx*dx + dy*dy)

Found this useful? How about buying me a coffee - simply click here.


0 Responses to “Distance Between two Points”


  1. No Comments

Leave a Reply




Close
E-mail It