Last active
August 29, 2015 14:03
-
-
Save sylvia43/cbd1fc3c53ffff588187 to your computer and use it in GitHub Desktop.
Update an objects location using 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
// cx: X position of object to rotate around. | |
// cy: Y position of object to rotate around. | |
// theta: Angle to be from object, 0 is right, CCW. | |
// r: Distance from object to rotate around. | |
x = cos(degtorad(theta))*r + cx; | |
y = sin(degtorad(theta))*r + cy; | |
// Usage: | |
// Jump to this point. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment