Saltar la navegación

Rotación

Ejemplo de rotación respecto al origen

Queremos rotar un punto P = (3, -1) en un ángulo de 45° respecto al origen en (0, 0). ¿Donde terminará el punto?

Diagrama del ejemplo de rotación respecto al origenDatos

\begin{equation} \begin{gathered} P = (3, -1) \\ \theta = 45^\circ \\ P' = (?, ?) \\ \end{gathered} \end{equation}

Procedimiento

Convertimos las coordenadas en un vector renglón de coordenadas homogéneas, y obtenemos la matriz de rotación según el ángulo dado.

\begin{align} P = \begin{bmatrix} 3 & -1 & 1 \end{bmatrix}, \quad R = \begin{bmatrix} \cos(45) & \sin(45) & 0 \\ -\sin(45) & \cos(45) & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{align}

Llevamos a cabo la multiplicación para obtener el vector de P'.

\begin{equation} \begin{gathered} P' = PR = \begin{bmatrix} 3 & -1 & 1 \end{bmatrix} \begin{bmatrix} \cos(45) & \sin(45) & 0 \\ -\sin(45) & \cos(45) & 0 \\ 0 & 0 & 1 \end{bmatrix} = \\ \begin{bmatrix} 3\cos(45) + \sin(45) + 0 & 3\sin(45) - \cos(45) + 0 & 0 + 0 + 1 \end{bmatrix} = \begin{bmatrix} 2.83 & 1.41 & 1 \end{bmatrix} \end{gathered} \end{equation}

Resultado

\begin{equation} P' = (2.83, 1.41) \end{equation}

Diagrama de la solución del ejemplo de rotación respecto al origen

Ejemplo de rotación general

Ahora, queremos rotar el punto P = (1, 2) respecto a un punto de origen C = (-1, 1) en un ángulo de 90°. ¿Cuál será la nueva posición del punto?

Diagrama del ejemplo de rotación general

Datos

\begin{equation} \begin{gathered} P = (1, 2) \\ C = (-1, 1) \\ \theta = 90^\circ \\ P' = (?, ?) \\ \end{gathered} \end{equation}

Procedimiento

Para este problema requerimos tres matrices de transformación. La primera de ellas involucra regresar el punto C al origen:

\begin{equation} T(-C) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -(-1) & -1 & 1 \end{bmatrix} \end{equation}

La segunda es la rotación en sí, en base al ángulo dado. Para simplificar los valores de esta matriz en este caso particular, podemos aprovechar que tenemos un ángulo de 90° y que sen(90) = 1 y cos(90) = 0:

\begin{equation} R = \begin{bmatrix} \cos(90) & \sin(90) & 0 \\ -\sin(90) & \cos(90) & 0 \\ 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 \\ -1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{equation}

La tercera matriz es aquella que regresa el punto C a su posición original:

\begin{equation} T(C) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -1 & 1 & 1 \end{bmatrix} \end{equation}

Para obtener el resultado se multiplica el vector renglón P las matrices T(-C), R y T(C). La multiplicación se lleva a cabo de derecha a izquierda, de la siguiente manera:

\begin{equation} \begin{gathered} P' = \begin{bmatrix} 3 & -1 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & -1 & 1 \end{bmatrix} \begin{bmatrix} 0 & 1 & 0 \\ -1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -1 & 1 & 1 \end{bmatrix} = \\ \begin{bmatrix} 3 & -1 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & -1 & 1 \end{bmatrix} \begin{bmatrix} 0 & 1 & 0 \\ -1 & 0 & 0 \\ -1 & 1 & 1 \end{bmatrix} = \\ \begin{bmatrix} 3 & -1 & 1 \end{bmatrix} \begin{bmatrix} 0 & 1 & 0 \\ -1 & 0 & 0 \\ 0 & 2 & 1 \\ \end{bmatrix} = \begin{bmatrix} -2 & 3 & 1 \end{bmatrix} \end{gathered} \end{equation}

Resultado

\begin{equation} P' = (-2, 3) \end{equation}

Diagrama del resultado del ejemplo de rotación general