Last active
May 29, 2020 12:43
-
-
Save brianfoody/34153c4073259a896ec7bfd665d0762c 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 edgePointCalculatorFor = (center: number, radius: number) => (degree: number): Point => { | |
const degreeInRadians = degToRadians(degree); | |
return [ | |
center + Math.cos(degreeInRadians) * radius, | |
center + Math.sin(degreeInRadians) * radius | |
]; | |
}; | |
const calculateEdgePoint = edgePointCalculatorFor(60, 50); | |
const eightyDegreesAlongCircle = calculateEdgePoint(80) | |
const twentyDegreesAlongCircle = calculateEdgePoint(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment