Created
September 10, 2017 10:35
-
-
Save radzionc/515729de136197919a7d0d06adb95537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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