In this task, we will study the effect of motion (rotation and translation) on a rigid body. To study this, we construct a very simple rigid body $r_1$ consisting of only two points $r_1=\{O, X\}$. To describe the relative position of these two points, we introduce a coordinate system $(O, \beta)$ with the origin at one of these points - $O$ and the standard basis $\beta$. The second point $X$ can thus be expressed as a vector $\vec{x}_\beta$ in this coordinate system. We set $\vec{x}_\beta = [1,2,3]^\top$. Now we apply the given motion on this rigid body represented by the coordinate system. That will result in a new coordinate system $(O', \beta')$. We construct a new rigid body $r_2 = \{O', Y\}$ where $Y$ has the same relative pose as $X$ in $r_1$, i.e. $\vec{y}'_{\beta'} = [1,2,3]^\top$, where $\vec{y}'$ is a vector expressing $Y$ in $(O', \beta')$. Finally, we apply the motion on point $X$ denoting it as $Z$. What are the coordinates of point $Z$?
Use Python to solve the following problems related to rigid motion. Use different colors to display your results.
# approximate rotation R = np.array([[0.8047, -0.5059, -0.3106], [0.3106, 0.8047, -0.5059], [0.5059, 0.3106, 0.8047]])
# less approximate rotation u, s, vh = np.linalg.svd(R) R = u.dot(vh)
# translation O'O_β' o_beta_pr = np.array([[1], [1], [1]])
Create an empty dictionary in Python:
solution = {}
The keys for this dictionary will be:
“b1_beta_pr”
(3×1), “b2_beta_pr”
(3×1), “b3_beta_pr”
(3×1) containing the coordinates of vectors of $\beta$ in $\beta'$
“b1_pr_beta”
(3×1), “b2_pr_beta”
(3×1), “b3_pr_beta”
(3×1) containing the coordinates of vectors of $\beta'$ in $\beta$
“oz_beta”
(3×1) containing the coordinates of $\overrightarrow{OZ}_\beta$.
Finally, save solution
to hw04.json
:
import json with open("hw04.json", "w") as outfile: json.dump(solution, outfile)Upload a zip archive
hw04.zip
(via the course ware) containing the following files:
hw04.py
- python script used for computation
hw04.pdf
- report file describing your solution with all figures
hw04.json