Skip to content

Instantly share code, notes, and snippets.

@brianfoody
Last active May 29, 2020 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianfoody/34153c4073259a896ec7bfd665d0762c to your computer and use it in GitHub Desktop.
Save brianfoody/34153c4073259a896ec7bfd665d0762c to your computer and use it in GitHub Desktop.
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