Skip to content

Instantly share code, notes, and snippets.

@wackoisgod
Created July 14, 2015 06:49
Show Gist options
  • Save wackoisgod/f3652ed3c266236aee16 to your computer and use it in GitHub Desktop.
Save wackoisgod/f3652ed3c266236aee16 to your computer and use it in GitHub Desktop.
Some code for me
var x = new Point(3, 3);
var y = new Point(1, 2);
var x1 = y.X - x.X;
var y1 = y.Y - x.Y;
var scale = Math.Max(Math.Abs(x1), Math.Abs(y1));
var direction = new Point(x1 / scale, y1 / scale);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment