Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

COORDINATE ROTATION AND BOUNCING OFF ANGLES > Advanced coordinate rotation

Advanced coordinate rotation

If you are going to be rotating objects around a point, and you are starting with just their positions, I've got a formula for you. The formula just needs the x, y position of the object in relation to the center point and the angle to rotate by. It returns the new x, y position of the object, relative to the center. Here's the basic formula:

x1 = cos(angle) * x - sin(angle) * y;
y1 = cos(angle) * y + sin(angle) * x;


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint