129 lines
2.3 KiB
Markdown
129 lines
2.3 KiB
Markdown
---
|
|
summary: "Würfelrotation mit Matrizen die Multipliziert werden erkläret"
|
|
---
|
|
|
|
# Rotation eines Würfels um die x-Achse
|
|
|
|
Wir wollen verstehen, wie man einen Würfel im Raum um die x-Achse dreht.
|
|
|
|
## 1. Punkte eines Würfels
|
|
|
|
Ein Würfel hat 8 Eckpunkte. Wenn wir den Würfel in der Mitte des Koordinatensystems platzieren, können wir die Punkte als Vektoren schreiben:
|
|
|
|
$$
|
|
\mathbf{A} = (1, 1, 1), \quad
|
|
\mathbf{B} = (1, 1, -1), \quad
|
|
\mathbf{C} = (1, -1, 1), \quad
|
|
\mathbf{D} = (1, -1, -1)
|
|
$$
|
|
|
|
$$
|
|
\mathbf{E} = (-1, 1, 1), \quad
|
|
\mathbf{F} = (-1, 1, -1), \quad
|
|
\mathbf{G} = (-1, -1, 1), \quad
|
|
\mathbf{H} = (-1, -1, -1)
|
|
$$
|
|
|
|
Jeder Punkt hat drei Koordinaten
|
|
$$
|
|
(x', y', z')
|
|
$$
|
|
|
|
## 2. Rotationsmatrix um die x-Achse
|
|
|
|
Wenn wir einen Punkt
|
|
|
|
$$
|
|
\mathbf{v} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}
|
|
$$
|
|
|
|
um die x-Achse um einen Winkel $\theta$ drehen wollen, benutzen wir die Rotationsmatrix:
|
|
|
|
$$
|
|
R_x(\theta) =
|
|
\begin{pmatrix}
|
|
1 & 0 & 0 \\
|
|
0 & \cos\theta & -\sin\theta \\
|
|
0 & \sin\theta & \cos\theta
|
|
\end{pmatrix}
|
|
$$
|
|
|
|
**Hinweis:**
|
|
- Die x-Koordinate bleibt gleich, weil wir um die x-Achse drehen.
|
|
- y und z verändern sich je nach Winkel $\theta$.
|
|
|
|
## 3. Berechnung des neuen Punktes
|
|
|
|
Der neue Punkt $\mathbf{v}'$ nach der Drehung ist:
|
|
|
|
$$
|
|
\mathbf{v}' = R_x(\theta) \mathbf{v} =
|
|
\begin{pmatrix}
|
|
1 & 0 & 0 \\
|
|
0 & \cos\theta & -\sin\theta \\
|
|
0 & \sin\theta & \cos\theta
|
|
\end{pmatrix}
|
|
\begin{pmatrix} x \\ y \\ z \end{pmatrix} =
|
|
\begin{pmatrix}
|
|
x \\
|
|
y \cos\theta - z \sin\theta \\
|
|
y \sin\theta + z \cos\theta
|
|
\end{pmatrix}
|
|
$$
|
|
|
|
## 4. Beispiel
|
|
|
|
Drehen wir den Punkt
|
|
|
|
$$
|
|
\mathbf{A} = (1,1,1)
|
|
$$
|
|
|
|
um
|
|
|
|
$$
|
|
\theta = 90^\circ = \frac{\pi}{2}
|
|
$$
|
|
|
|
Dann gilt:
|
|
|
|
$$
|
|
\cos \theta = 0, \quad \sin \theta = 1
|
|
$$
|
|
|
|
$$
|
|
\mathbf{A}' =
|
|
\begin{pmatrix}
|
|
1 \\
|
|
1 \cdot 0 - 1 \cdot 1 \\
|
|
1 \cdot 1 + 1 \cdot 0
|
|
\end{pmatrix} =
|
|
\begin{pmatrix}
|
|
1 \\ -1 \\ 1
|
|
\end{pmatrix}
|
|
$$
|
|
|
|
## 5. Tabelle aller Punkte nach Rotation
|
|
|
|
$$
|
|
\begin{array}{c|c}
|
|
\text{Originalpunkt} & \text{Punkt nach Rotation} \\
|
|
\hline
|
|
A (1,1,1) & (1,-1,1) \\
|
|
B (1,1,-1) & (1,-1,-1) \\
|
|
C (1,-1,1) & (1,-1,-1) \\
|
|
D (1,-1,-1) & (1,1,-1) \\
|
|
E (-1,1,1) & (-1,-1,1) \\
|
|
F (-1,1,-1) & (-1,-1,-1) \\
|
|
G (-1,-1,1) & (-1,1,1) \\
|
|
H (-1,-1,-1) & (-1,1,-1) \\
|
|
\end{array}
|
|
$$
|
|
|
|
## Fazit
|
|
|
|
- x bleibt unverändert
|
|
- y und z ändern sich je nach Winkel
|
|
- Rotationsmatrizen sind ein mächtiges Werkzeug, um Objekte im 3D-Raum zu bewegen
|
|
|