```python
from sympy import *
init_printing()
```


```python
alpha, a, d, theta = symbols('alpha a d theta')
```


```python
def sTx(v):
    R = Matrix([[1,0,0,0],[0,cos(v),-sin(v),0],[0, sin(v), cos(v),0],[0,0,0,1]])
    return R

def sTy(v):
    R = Matrix([[cos(v),0,sin(v),0],[0,1,0,0],[sin(v), 0, cos(v),0],[0,0,0,1]])
    return R

def sTz(v):
    R = Matrix([[cos(v),-sin(v),0,0],[sin(v),cos(v),0,0],[0, 0, 1,0],[0,0,0,1]])
    return R

def sD(v,op):
    if op.lower() == 'x':
        D = Matrix([[1,0,0,v],[0,1,0,0],[0,0,1,0],[0,0,0,1]])
    if op.lower() == 'y':
        D = Matrix([[1,0,0,0],[0,1,0,v],[0,0,1,0],[0,0,0,1]])
    if op.lower() == 'z':
        D = Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,v],[0,0,0,1]])
    return D
```


```python
Tx = sTx(alpha)
Tx
```




$$\left[\begin{matrix}1 & 0 & 0 & 0\\0 & \cos{\left (\alpha \right )} & - \sin{\left (\alpha \right )} & 0\\0 & \sin{\left (\alpha \right )} & \cos{\left (\alpha \right )} & 0\\0 & 0 & 0 & 1\end{matrix}\right]$$




```python
Dx = sD(d,'x')
Dz = sD(d,'z')
Dz
```




$$\left[\begin{matrix}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\0 & 0 & 1 & d\\0 & 0 & 0 & 1\end{matrix}\right]$$




```python
def FrameT():
    return sTx(alpha)*sD(a,'x')*sTz(theta)*sD(d,'z')
```


```python
x = FrameT()
x
```




$$\left[\begin{matrix}\cos{\left (\theta \right )} & - \sin{\left (\theta \right )} & 0 & a\\\sin{\left (\theta \right )} \cos{\left (\alpha \right )} & \cos{\left (\alpha \right )} \cos{\left (\theta \right )} & - \sin{\left (\alpha \right )} & - d \sin{\left (\alpha \right )}\\\sin{\left (\alpha \right )} \sin{\left (\theta \right )} & \sin{\left (\alpha \right )} \cos{\left (\theta \right )} & \cos{\left (\alpha \right )} & d \cos{\left (\alpha \right )}\\0 & 0 & 0 & 1\end{matrix}\right]$$




```python

```

7c2d398bb4d2d8a65e663624c199d58ed1770c7d
ipynb
Jupyter Notebook
python/Cap1/jupyterNotebook/Euler Angles.ipynb
silvajhonatan/robotics
d1097809e88c744658dab6d661092b6ea8f0e13a
MIT
2017-11-16T18:34:27.000Z
2021-01-28T15:33:46.000Z
python/Cap1/jupyterNotebook/Euler Angles.ipynb
sjhonatan/robotics
d1097809e88c744658dab6d661092b6ea8f0e13a
MIT
python/Cap1/jupyterNotebook/Euler Angles.ipynb
sjhonatan/robotics
d1097809e88c744658dab6d661092b6ea8f0e13a
MIT
Qwen/Qwen-72B
1. YES
2. YES