Skip to content

Instantly share code, notes, and snippets.

@ikekou
Last active December 17, 2015 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikekou/5559123 to your computer and use it in GitHub Desktop.
Save ikekou/5559123 to your computer and use it in GitHub Desktop.
[Math][JavaScript][CoffeeScript]座標(p1x,p1y)と(p2x,p2y)の距離を求める
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