Created
June 26, 2019 22:11
-
-
Save nrkn/1a5a75d6e93009b965a58982cd2fed27 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const createPoint = ( x, y ) => ({ x, y }) | |
export const isPoint = value => | |
value && typeof value.x === 'number' && typeof value.y === 'number' | |
export const translatePoint = ( { x: x0, y: y0 }, { x: x1, y: y1 } ) => | |
createPoint( x0 + x1, y0 + y1 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment