Last active
September 10, 2017 10:40
-
-
Save radzionc/fa145857869bd1c464489ae510f428a2 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
const create = (proto, props) => | |
Object.assign(Object.create(proto), props) | |
const Vector2D = (x, y) => create({ | |
}, { | |
x, | |
y, | |
length: Math.hypot(x, y) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment