-
-
Save ruthenium/7910073d4016c65895d86c3457cdfdc6 to your computer and use it in GitHub Desktop.
Converting cartesian coordinates to polar coordinates
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
function cartesianToPolar(x,y){ | |
return { | |
radius: Math.sqrt( Math.pow(x, 2) + Math.pow(y, 2) ), | |
alpha: Math.atan2(y, x) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment