Questions tagged [rotations]

This tag is for questions about *rotations*: a type of rigid motion in a space.

In 2-dimensional and 3-dimensional Euclidean space, the rotation is a type of distance-preserving linear transformation that has a fixed point and preserves orientation. In terms of the usual inner product $\langle\cdot,\cdot\rangle$ on $\Bbb R^2$ and $\Bbb R^3$, rotations are the transformations $T$ such that $\langle Tx,Ty\rangle=\langle x,y\rangle$ for all $x,y$, and the determinant of $T$ is equal to 1.

Geometrically, the rotation in $\Bbb R^2$, "spins" the plane around a point without flipping the plane or sliding it. In $\Bbb R^3$, a rotation fixes a line (called the axis of rotation) and "spins" the space around this line (without reflecting or sliding).

More generally, given an inner product space $V$ over a field $\Bbb F$, anything in the part of the orthogonal group connected to the identity can be considered a "rotation." This allows rotations to be defined for $\Bbb R^n$ for $n$ greater than 2 and 3, as well as vector spaces over fields other than $\Bbb R$.

As an example, the space $\Bbb R^4$ with a non-Euclidean metric $(1,1,1,-1)$ is Minkowski space which is a model for special relativity. Rotations still play an important role here beyond that of rotations in the spacial coordinates. For example, Lorentz transformations are rotations which move the time coordinate.

Rotations can also be represented in terms of matrices and the tag often goes with this tag, as questions can pertain to rotation matrices.

2889 questions
167
votes
20 answers

Calculate Rotation Matrix to align Vector A to Vector B in 3d?

I have one triangle in 3d space that I am tracking in a simulation. Between time steps I have the the previous normal of the triangle and the current normal of the triangle along with both the current and previous 3d vertex positions of the…
user1084113
  • 1,849
  • 4
  • 13
  • 10
91
votes
2 answers

Modelling the "Moving Sofa"

I believe that many of you know about the moving sofa problem; if not you can find the description of the problem here. In this question I am going to rotate the L shaped hall instead of moving a sofa around the corner. By rotating the hall…
newzad
  • 4,683
  • 23
  • 49
90
votes
9 answers

Why are rotational matrices not commutative?

Is there any intuition why rotational matrices are not commutative? I assume the final rotation is the combination of all rotations. Then how does it matter in which order the rotations are applied?
Navin Prashath
  • 1,035
  • 1
  • 9
  • 9
81
votes
5 answers

Math behind rotation in MS Paint

For those who don't know, MS Paint only has the options to rotate an image by right angles. To carry out an arbitrary rotation ($\theta^\circ$), the following hack is suggested: Horizontal skew by $\theta$ Vertical Stretch by $\displaystyle…
kuch nahi
  • 6,481
  • 7
  • 41
  • 77
74
votes
6 answers

Geometric interpretation for complex eigenvectors of a 2×2 rotation matrix

The rotation matrix $$\pmatrix{ \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta}$$ has complex eigenvalues $\{e^{\pm i\theta}\}$ corresponding to eigenvectors $\pmatrix{1 \\i}$ and $\pmatrix{1 \\ -i}$. The real eigenvector of a 3d rotation…
61
votes
15 answers

Area of a square inside a square created by connecting point-opposite midpoint

Square $ABCD$ has area $1cm^2$ and sides of $1cm$ each. $H, F, E, G$ are the midpoints of sides $AD, DC, CB, BA$ respectively. What will the area of the square formed in the middle be? I know that this problem can be solved by trigonometry by using…
Agile_Eagle
  • 2,732
  • 1
  • 22
  • 40
53
votes
5 answers

How do you rotate a vector by a unit quaternion?

Given a 3-variable right-handed vector v that is a translation measured in local space and a unit quaternion representing an orientation from local to world space, how do you use the quaternion to rotate the vector from local space to world…
Narf the Mouse
  • 703
  • 2
  • 7
  • 8
47
votes
3 answers

Rotation Matrix of rotation around a point other than the origin

In homogeneous coordinates, a rotation matrix around the origin can be described as $R = \begin{bmatrix}\cos(\theta) & -\sin(\theta) & 0\\\sin(\theta) & \cos(\theta) & 0 \\ 0&0&1\end{bmatrix}$ with the angle $\theta$ and the rotation being…
Dschoni
  • 718
  • 1
  • 6
  • 16
39
votes
3 answers

Find the coordinates of a point on a circle

I have a circle like so $r$, with angle $\theta$ to the $y$-axis"> Given a rotation θ and a radius r, how do I find the coordinate (x,y)? Keep in mind, this rotation could be anywhere between 0 and 360 degrees. For example, I have a radius of 12…
CoderTheTyler
  • 497
  • 2
  • 5
  • 10
39
votes
1 answer

Generalized rotation matrix in N dimensional space around N-2 unit vector

There is a 2d rotation matrix around point $(0, 0)$ with angle $\theta$. $$ \left[ \begin{array}{ccc} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{array} \right] $$ Next, there is a 3d rotation matrix around point $(0, 0, 0)$ and…
Ivan Kochurkin
  • 1,075
  • 1
  • 11
  • 25
37
votes
2 answers

Understanding rotation matrices

How does $ {\sqrt 2 \over 2} = \cos (45^\circ)$? Is my graph (the one underneath the original) accurate with how I've depicted the representation of the triangle that the trig function represent? What I mean is, the blue triangle is the…
user3871
  • 649
  • 1
  • 9
  • 18
34
votes
9 answers

"Random" generation of rotation matrices

For a current project, I need to generate several $3\times 3$ rotation matrices for input into an algorithm. I thought I might go about this by randomly generating the number of elements needed to define a rotation matrix and then calculating the…
bob.sacamento
  • 3,768
  • 2
  • 15
  • 23
28
votes
3 answers

How to find an angle in range(0, 360) between 2 vectors?

I know that the common approach in order to find an angle is to calculate the dot product between 2 vectors and then calculate arcus cos of it. But in this solution I can get an angle only in the range(0, 180) degrees. What would be the proper way…
Savail
  • 425
  • 1
  • 4
  • 6
28
votes
3 answers

Why are orthogonal matrices generalizations of rotations and reflections?

I recently took linear algebra course, all that I learned about orthogonal matrix is that Q transposed is Q inverse, and therefore it has a nice computational property. Recently, to my surprise, I learned that transformations by orthogonal matrices…
27
votes
4 answers

Can rotations in 4D be given an explicit matrix form?

Rotation in 2D by an angle $t$ can be performed using $$R=\begin{pmatrix}\cos(t) &-\sin(t) \\ \sin(t) & \cos(t)\end{pmatrix}$$ matrix. But, if I want to rotate a point or vector in 4D, is there any rotation matrix in explicit form? I have read…
user263007
  • 271
  • 1
  • 3
  • 3
1
2 3
99 100