Rotating Shapes (2D C++)


by sarah22
Tags: rotating, shapes
sarah22
sarah22 is offline
#1
Apr9-09, 12:55 PM
P: 26
I'm creating a C++ 2D program to practice my 2D skills. I'm almost done with everything but I'm stuck on this crap. Is there any formula on how to rotate a shape?

Example:

I have a line P1(-1,-1) P2(1,1)

If I rotate it by 45 degrees, I'll get a P1(1,-1) P2(-1,1). By the way, it should not leave its center which is C(0,0).
Phys.Org News Partner Science news on Phys.org
NASA's space station Robonaut finally getting legs
Free the seed: OSSI nurtures growing plants without patent barriers
Going nuts? Turkey looks to pistachios to heat new eco-city
Coin
Coin is offline
#2
Apr9-09, 03:13 PM
P: 587
http://www.cgafaq.info/wiki/2D_Point_Rotation
sarah22
sarah22 is offline
#3
Apr10-09, 05:54 AM
P: 26
Ok thanks I got it.


Register to reply

Related Discussions
Frictional Moment produced by contact between rotating and non-rotating surfaces Introductory Physics Homework 1
3-D shapes General Math 2
4D Shapes General Physics 6