Skip to content

Instantly share code, notes, and snippets.

View slvrfn's full-sized avatar

Cameron White slvrfn

View GitHub Profile

Keybase proof

I hereby claim:

  • I am slvrfn on github.
  • I am slvrfn (https://keybase.io/slvrfn) on keybase.
  • I have a public key ASCnZPFXeX0nxxPjKXJgTxo0EpvvijIFRUzf2fZMDAGQ6Qo

To claim this, I am signing this object:

//obtain new point on the line defined by (x0,y0) to (x1,y1)
//a t in the range [0,1] sits on the line
//a t > 1 sits on the line past (x1,y1)
function proj(x0, y0, x1, y1, t){
return [((1-t)*x0)+(t*x1), ((1-t)*y0)+(t*y1)];
}
//https://math.stackexchange.com/a/1630886/368351