PDA

View Full Version : 2D Rotation about center of mass


janguera
Jan 26, 2006, 03:04 PM
Hey Everyone!

I've posted this question on both the physics and math sites, but I'm hoping that by fishing in all three that I might get an answer sooner! With that in mind...


I'm trying to figure out how to calculate the resultant polar coordinates of a triangle following the triangle's 45 degree rotation about it's own center of mass. I've seen how to rotate the triangle about the center of the screen using:

In 2D, you make (X,Y) from (x,y) with a rotation by angle t so:
X = x cos t - y sin t
Y = x sin t + y cos t

... but this only rotates the triangle with regards to the background. I want to figure out a way to find the NEW polar coordinates of the triangle after a 45 degree rotation with regards to its own center of mass. Any and all suggestions/comments are welcome!

Joaq

wandersciencer
Nov 6, 2011, 02:41 AM
first you get the differente between each pont of the triangle and the center of it.Then rotate the new coordiantes with the rotation formula and again add (reverse the first operation) to te rotated points the coordinates of the center of the triangle: so
x(center of masses)=(x1+x2+x3)/3;y(center of masses)=(y1+y2+y3)/3;
x1'=x1-x;y1'=y1-y; and so on;
x1rotated=x1'*cos(angle)-y1'*sin(angle) and y1rotated=x1'*sin(angle)+y1'*cos(angle);
finally=> x1''=x1rotated+x ; y1''=y1rotated+y;