Last active
December 17, 2015 05:38
-
-
Save ikekou/5559123 to your computer and use it in GitHub Desktop.
[Math][JavaScript][CoffeeScript]座標(p1x,p1y)と(p2x,p2y)の距離を求める
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getDistance:(p1x,p1y,p2x,p2y)-> | |
dx=p1x-p2x | |
dy=p1y-p2y | |
return Math.sqrt(dx*dx+dy*dy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment