Skip to content

Instantly share code, notes, and snippets.

@FreekPaans
Created July 23, 2015 07:15
Show Gist options
  • Save FreekPaans/2879b8ff484cb36a8cd9 to your computer and use it in GitHub Desktop.
Save FreekPaans/2879b8ff484cb36a8cd9 to your computer and use it in GitHub Desktop.
function Vector(x, y) {
this.X = function() {
return x;
}
this.Y = function() {
return y;
}
this.Add = function(addend) {
return new Vector(x + addend.X(), y+addend.Y())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment