/ Published in: JavaScript
Expand |
Embed | Plain Text
function distance (x1, y1, x2, y2) { var dx = x2 - x1; var dy = y2 - y1; return Math.sqrt(dx * dx + dy * dy); }
You need to login to post a comment.
inamorix on 01/08/08
2 people have marked this snippet as a favorite
function distance (x1, y1, x2, y2) { var dx = x2 - x1; var dy = y2 - y1; return Math.sqrt(dx * dx + dy * dy); }
You need to login to post a comment.