# Rotation of axes

An xy-Cartesian coordinate system rotated through an angle ${\displaystyle \theta }$ to an x'y'-Cartesian coordinate system

In mathematics, a rotation of axes in two dimensions is a mapping from an xy-Cartesian coordinate system to an x'y'-Cartesian coordinate system in which the origin is kept fixed and the x' and y' axes are obtained by rotating the x and y axes counterclockwise through an angle ${\displaystyle \theta }$. A point P has coordinates (x, y) with respect to the original system and coordinates (x', y') with respect to the new system.[1] In the new coordinate system, the point P will appear to have been rotated in the opposite direction, that is, clockwise through the angle ${\displaystyle \theta }$. A rotation of axes in more than two dimensions is defined similarly.[2][3] A rotation of axes is a linear map[4][5] and a rigid transformation.

## Motivation

Coordinate systems are essential for studying the equations of curves using the methods of analytic geometry. To use the method of coordinate geometry, the axes are placed at a convenient position with respect to the curve under consideration. For example, to study the equations of ellipses and hyperbolas, the foci are usually located on one of the axes and are situated symmetrically with respect to the origin. If the curve (hyperbola, parabola, ellipse, etc.) is not situated conveniently with respect to the axes, the coordinate system should be changed to place the curve at a convenient and familiar location and orientation. The process of making this change is called a transformation of coordinates.[6]

The solutions to many problems can be simplified by rotating the coordinate axes to obtain new axes through the same origin.

## Derivation

The equations defining the transformation in two dimensions, which rotates the xy axes counterclockwise through an angle ${\displaystyle \theta }$ into the x'y' axes, are derived as follows.

In the xy system, let the point P have polar coordinates ${\displaystyle (r,\alpha )}$. Then, in the x'y' system, P will have polar coordinates ${\displaystyle (r,\alpha -\theta )}$.

We have

${\displaystyle x=r\cos \alpha }$

(1)

${\displaystyle y=r\sin \alpha }$

(2)

and

${\displaystyle x'=r\cos(\alpha -\theta )=r\cos \alpha \cos \theta +r\sin \alpha \sin \theta }$

(3)

${\displaystyle y'=r\sin(\alpha -\theta )=r\sin \alpha \cos \theta -r\cos \alpha \sin \theta .}$

(4)

Substituting equations (1) and (2) into equations (3) and (4), we obtain

${\displaystyle x'=x\cos \theta +y\sin \theta }$

(5)

${\displaystyle y'=-x\sin \theta +y\cos \theta .}$[7]

(6)

Equations (5) and (6) can be represented in matrix form as

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}\cos \theta &\sin \theta \\-\sin \theta &\cos \theta \end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}},}$

which is the standard matrix equation of a rotation of axes in two dimensions.[8]

The inverse transformation is

${\displaystyle x=x'\cos \theta -y'\sin \theta }$

(7)

${\displaystyle y=x'\sin \theta +y'\cos \theta ,}$[9]

(8)

or

${\displaystyle {\begin{pmatrix}x\\y\end{pmatrix}}={\begin{pmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{pmatrix}}{\begin{pmatrix}x'\\y'\end{pmatrix}}.}$

## Examples in two dimensions

### Example 1

Find the coordinates of the point ${\displaystyle P_{1}=(x,y)=({\sqrt {3}},1)}$ after the axes have been rotated through the angle ${\displaystyle \theta _{1}=\pi /6}$, or 30°.

Solution:

${\displaystyle x'={\sqrt {3}}\cos(\pi /6)+1\sin(\pi /6)=({\sqrt {3}})({\sqrt {3}}/2)+(1)(1/2)=2}$
${\displaystyle y'=1\cos(\pi /6)-{\sqrt {3}}\sin(\pi /6)=(1)({\sqrt {3}}/2)-({\sqrt {3}})(1/2)=0.}$

The axes have been rotated counterclockwise through an angle of ${\displaystyle \theta _{1}=\pi /6}$ and the new coordinates are ${\displaystyle P_{1}=(x',y')=(2,0)}$. Note that the point appears to have been rotated clockwise through ${\displaystyle \pi /6}$, that is, it now coincides with the (new) x' axis.

### Example 2

Find the coordinates of the point ${\displaystyle P_{2}=(x,y)=(7,7)}$ after the axes have been rotated clockwise 90°, that is, through the angle ${\displaystyle \theta _{2}=-\pi /2}$, or -90°.

Solution:

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}\cos(-\pi /2)&\sin(-\pi /2)\\-\sin(-\pi /2)&\cos(-\pi /2)\end{pmatrix}}{\begin{pmatrix}7\\7\end{pmatrix}}={\begin{pmatrix}0&-1\\1&0\end{pmatrix}}{\begin{pmatrix}7\\7\end{pmatrix}}={\begin{pmatrix}-7\\7\end{pmatrix}}.}$

The axes have been rotated through an angle of ${\displaystyle \theta _{2}=-\pi /2}$, which is in the clockwise direction and the new coordinates are ${\displaystyle P_{2}=(x',y')=(-7,7)}$. Again, note that the point appears to have been rotated counterclockwise through ${\displaystyle \pi /2}$.

## Rotation of conic sections

The most general equation of the second degree has the form

${\displaystyle Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0}$      (${\displaystyle A,B,C}$ not all zero).[10]

(9)

Through a change of coordinates (a rotation of axes and a translation of axes), equation (9) can be put into a standard form, which is usually easier to work with. It is always possible to rotate the coordinates in such a way that in the new system there is no x'y' term. Substituting equations (7) and (8) into equation (9), we obtain

${\displaystyle A'x'^{2}+B'x'y'+C'y'^{2}+D'x'+E'y'+F'=0,}$

(10)

where

${\displaystyle A'=A\cos ^{2}\theta +B\sin \theta \cos \theta +C\sin ^{2}\theta ,}$
${\displaystyle B'=2(C-A)\sin \theta \cos \theta +B(\cos ^{2}\theta -\sin ^{2}\theta ),}$
${\displaystyle C'=A\sin ^{2}\theta -B\sin \theta \cos \theta +C\cos ^{2}\theta ,}$
${\displaystyle D'=D\cos \theta +E\sin \theta ,}$
${\displaystyle E'=-D\sin \theta +E\cos \theta ,}$
${\displaystyle F'=F.}$

(11)

If ${\displaystyle \theta }$ is selected so that ${\displaystyle \cot 2\theta =(A-C)/B}$ we will have ${\displaystyle B'=0}$ and the x'y' term in equation (10) will vanish.[11]

When a problem arises with B, D and E all different from zero, they can be eliminated by performing in succession a rotation (eliminating B) and a translation (eliminating the D and E terms).[12]

### Identifying rotated conic sections

A non-degenerate conic section given by equation (9) can be identified by evaluating ${\displaystyle B^{2}\ -\ 4AC}$. The conic section is:

${\displaystyle {\begin{cases}{\mbox{an ellipse or a circle}},\ {\mbox{if}}\ B^{2}\ -\ 4AC\ <\ 0;\\{\mbox{a parabola}},\ {\mbox{if}}\ B^{2}\ -\ 4AC\ =\ 0;\\{\mbox{a hyperbola}},\ {\mbox{if}}\ B^{2}\ -\ 4AC\ >\ 0.\end{cases}}}$[13]

## Generalization to several dimensions

Suppose a rectangular xyz-coordinate system is rotated around its z axis counterclockwise (looking down the positive z axis) through an angle ${\displaystyle \theta }$, that is, the positive x axis is rotated immediately into the positive y axis. The z coordinate of each point is unchanged and the x and y coordinates transform as above. The old coordinates (x, y, z) of a point Q are related to its new coordinates (x', y', z') by

${\displaystyle {\begin{pmatrix}x'\\y'\\z'\end{pmatrix}}={\begin{pmatrix}\cos \theta &\sin \theta &0\\-\sin \theta &\cos \theta &0\\0&0&1\end{pmatrix}}{\begin{pmatrix}x\\y\\z\end{pmatrix}}.}$[14]

Generalizing to any finite number of dimensions, a rotation matrix ${\displaystyle A}$ is an orthogonal matrix that differs from the identity matrix in at most four elements. These four elements are of the form

${\displaystyle a_{ii}=a_{jj}=\cos \theta }$      and      ${\displaystyle a_{ij}=-a_{ji}=\sin \theta ,}$

for some ${\displaystyle \theta }$ and some ij.[15]

## Examples in several dimensions

### Example 3

Find the coordinates of the point ${\displaystyle P_{3}=(w,x,y,z)=(1,1,1,1)}$ after the positive w axis has been rotated through the angle ${\displaystyle \theta _{3}=\pi /12}$, or 15°, into the positive z axis.

Solution:

${\displaystyle {\begin{pmatrix}w'\\x'\\y'\\z'\end{pmatrix}}={\begin{pmatrix}\cos(\pi /12)&0&0&\sin(\pi /12)\\0&1&0&0\\0&0&1&0\\-\sin(\pi /12)&0&0&\cos(\pi /12)\end{pmatrix}}{\begin{pmatrix}w\\x\\y\\z\end{pmatrix}}}$
${\displaystyle \approx {\begin{pmatrix}0.96593&0.0&0.0&0.25882\\0.0&1.0&0.0&0.0\\0.0&0.0&1.0&0.0\\-0.25882&0.0&0.0&0.96593\end{pmatrix}}{\begin{pmatrix}1.0\\1.0\\1.0\\1.0\end{pmatrix}}={\begin{pmatrix}1.22475\\1.00000\\1.00000\\0.70711\end{pmatrix}}.}$

## Notes

1. ^ Protter & Morrey (1970, p. 320)
2. ^ Anton (1987, p. 231)
3. ^ Burden & Faires (1993, p. 532)
4. ^ Anton (1987, p. 247)
5. ^ Beauregard & Fraleigh (1973, p. 266)
6. ^ Protter & Morrey (1970, pp. 314-315)
7. ^ Protter & Morrey (1970, pp. 320-321)
8. ^ Anton (1987, p. 230)
9. ^ Protter & Morrey (1970, p. 320)
10. ^ Protter & Morrey (1970, p. 316)
11. ^ Protter & Morrey (1970, pp. 321-322)
12. ^ Protter & Morrey (1970, p. 324)
13. ^ Protter & Morrey (1970, p. 326)
14. ^ Anton (1987, p. 231)
15. ^ Burden & Faires (1993, p. 532)