Skip to content

Instantly share code, notes, and snippets.

@sikanrong
Last active May 25, 2017 22:26
Show Gist options
  • Select an option

  • Save sikanrong/72c7eae839c6739eb84cb07ee9d64364 to your computer and use it in GitHub Desktop.

Select an option

Save sikanrong/72c7eae839c6739eb84cb07ee9d64364 to your computer and use it in GitHub Desktop.
//y = ax + c; reflection line
var reflected = {};
var d = (point.x + (point.y - c)*a)/(1 + a^2);
reflected.x = 2*d - point.x;
reflected.y = 2*d*a - point.y + (2*c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment