Skip to content

Instantly share code, notes, and snippets.

@cosinekitty
Created June 10, 2020 00:25
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 cosinekitty/c57282d17dfd5d6c83aff126bcb99496 to your computer and use it in GitHub Desktop.
Save cosinekitty/c57282d17dfd5d6c83aff126bcb99496 to your computer and use it in GitHub Desktop.
function Polar(x, y) {
return {
angle: Math.atan2(y, x),
radius: Math.sqrt(x*x + y*y)
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment