Skip to content

Instantly share code, notes, and snippets.

@radzionc
Created September 10, 2017 10:35
Show Gist options
  • Save radzionc/515729de136197919a7d0d06adb95537 to your computer and use it in GitHub Desktop.
Save radzionc/515729de136197919a7d0d06adb95537 to your computer and use it in GitHub Desktop.
...
scaleBy (factor) {
return Vector2D(x * factor, y * factor)
},
negate () {
return this.scaleBy(-1)
},
normalize () {
return this.scaleBy(1 / this.length)
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment