How can I rotate a shape in 2D space?

In summary, to rotate a shape in 2d space, you can use the formula [x'; y'] = [cos(theta) sin(theta); -sin(theta) cos(theta)][x; y], where theta represents the angle of rotation. The shape must be encoded and specified in order to apply this formula accurately.
  • #1
fcs04001
3
0
How do I rotate some shape in 2d space? That is, what factor do I multiply the x and y components to rotate my shape?

Thanks.
 
Physics news on Phys.org
  • #2
fcs04001 said:
How do I rotate some shape in 2d space? That is, what factor do I multiply the x and y components to rotate my shape?

Thanks.

Sin of (y) and Cos of (x)

Think of a unit circle ( a cicle of Radius 1 around the origin)
 
  • #3
Before we can answer that unambiguously, you must first of all explain how you "encode" your shape, that is: how you store the information about your shape and how you "draw" it, or specify its position and angle.

--------
Assaf
http://www.physicallyincorrect.com/" [Broken]
 
Last edited by a moderator:
  • #4
I got it:
[x'; y'] = [cos(theta) sin(theta); -sin(theta) cos(theta)][x; y]

Thanks.
 

1. How do you rotate a shape in space?

To rotate a shape in space, you need to have a reference point and an axis of rotation. The shape will rotate around the axis, so the reference point needs to be fixed. Then, you can use rotation matrices or quaternions to calculate the new coordinates of the shape after rotation.

2. What is the difference between rotating a shape in 2D vs 3D space?

In 2D space, the shape can only rotate around one axis, usually the z-axis. In 3D space, the shape can rotate around any of the three axes - x, y, or z. Additionally, in 3D space, the shape can also have rotations around multiple axes simultaneously, creating complex movements.

3. How does the orientation of a shape affect its rotation in space?

The orientation of a shape refers to its initial position and direction in space. This affects the rotation because the shape will rotate around its own center of mass, which may not align with the center of the coordinate system. This means that the shape's orientation will change as it rotates, and the rotation may also affect the shape's position in space.

4. Can a shape rotate around a point other than its center of mass?

Yes, a shape can rotate around any fixed point in space. This is known as rotation about an arbitrary point, and it involves translating the shape so that the point of rotation becomes its center of mass, rotating the shape, and then translating it back to its original position. This can be useful for creating complex movements and animations.

5. How do you calculate the amount of rotation needed to align a shape with a specific orientation in space?

To calculate the amount of rotation needed, you can use a combination of rotation matrices and trigonometric functions. First, determine the difference between the current orientation of the shape and the desired orientation. Then, use the rotation matrices to calculate the rotations around each axis needed to align the shape with the desired orientation. Finally, use trigonometric functions to determine the exact angles of rotation needed for each axis.

Similar threads

  • Mechanics
Replies
2
Views
788
Replies
16
Views
1K
Replies
2
Views
725
Replies
15
Views
3K
  • Mechanics
Replies
9
Views
196
Replies
22
Views
2K
Replies
2
Views
686
Replies
19
Views
996
Back
Top