Skip to content

Instantly share code, notes, and snippets.

@ikekou
Last active December 17, 2015 05:39
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/5559128 to your computer and use it in GitHub Desktop.
Save ikekou/5559128 to your computer and use it in GitHub Desktop.
[Math][JavaScript][CoffeeScript] 座標(p1x,p2y)と座標(p2x,p2y)を結ぶ線分をt:1-tで分割した座標を求める
#座標(p1x,p2y)と座標(p2x,p2y)を結ぶ線分をt:1-tで分割した座標を求める
interpolate:(p1x,p1y,p2x,p2y,t)->
return [
p1x+(p2x-p1x)*t,
p1y+(p2y-p1y)*t
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment