Posted By

inamorix on 01/08/08


Tagged

js


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vali29
wizard04


distance


 / Published in: JavaScript
 

  1. function distance (x1, y1, x2, y2) {
  2. var dx = x2 - x1;
  3. var dy = y2 - y1;
  4. return Math.sqrt(dx * dx + dy * dy);
  5. }

Report this snippet  

You need to login to post a comment.