Created
April 1, 2017 14:32
-
-
Save conradoqg/02cd618782ffc94cfd00fad0ae5e2577 to your computer and use it in GitHub Desktop.
Rotate object
This file contains hidden or 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
| var newX = Math.cos(angle) * (this.x - origin.x) - Math.sin(angle) * (this.y - origin.y) + origin.x; | |
| var newY = Math.sin(angle) * (this.x - origin.x) + Math.cos(angle) * (this.y - origin.y) + origin.y; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment