Rotating an object about an arbitrary point – are there two cases or just one

geometryrotations

enter image description here

I'm trying to rotate an object about an arbitrary point (Figure 5) which is not in the bounds of the object I want to rotate. I believe there are two cases of rotation about an arbitrary point.

Case 1: Center of rotation is within the geometry of the object that is trying to rotate about it

Figure 1: I want to rotate the red square about the pink dot

Figure 2: I have translated the red square such that the pink dot is on the origin

Figure 3: I have applied a 2D rotation to the red square

Figure 4: I have translated the red square such that the pink dot is back in its original position.

I understand this clearly.

Case 2: Center of rotation is outside of the geometry of the object that is trying to rotate about it

Figure 5: Red square to rotate about the pink dot which is outside of its bounds.

Figure 6: Translate red square such that pink dot is at the origin

Figure 7: Rotate red square about its center

Figure 8: Translate red square such that pink dot is at its original position

I don't think the strategy of Case 1 works here because in Figure 7, the red square needs to rotate about its own origin and not the coordinate system origin, so I feel like there's an extra step involved which separates the two cases.

Apologies for the crude drawings, hopefully they make the problem statement more clear than not.

Thanks for any help!

Best Answer

Both cases are indeed the same case. When a rotation matrix is applied to an object, the rotation is always defined with respect to the coordinate system origin. Therefore, even though the technique used in Case 1 applies in Case 2, Figure 7 and Figure 8 are wrong. Had I correctly drawn the result of applying a rotation matrix to the red square in Figure 7, it would have rotated about the coordinate system origin and not its own origin. Since the coordinate system origin is the pink point, we have successfully rotated the red square about a point beyond its bounds. Once we apply the last step of translating the square such that the pink point is back in its original place, the transform is complete.

Related Question