Skip to content

Instantly share code, notes, and snippets.

@bpceee
Created July 26, 2015 14:14
Show Gist options
  • Save bpceee/0a58e4148e296439b255 to your computer and use it in GitHub Desktop.
Save bpceee/0a58e4148e296439b255 to your computer and use it in GitHub Desktop.
calculate the SVG Path for an arc (of a circle)
http://stackoverflow.com/questions/5736398/how-to-calculate-the-svg-path-for-an-arc-of-a-circle
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
var angleInRadians = angleInDegrees * Math.PI / 180.0;
var x = centerX + radius * Math.cos(angleInRadians);
var y = centerY + radius * Math.sin(angleInRadians);
return [x,y];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment