## Exploring reference frame


```python
import sympy as sp
import sympy.physics.mechanics as me
```


```python
psi = me.dynamicsymbols('psi')
x0,y0 = me.dynamicsymbols('x0 y0')
x01d,y01d = me.dynamicsymbols('x0 y0',1)

u,v = me.dynamicsymbols('u v')
```


```python
N = me.ReferenceFrame('N')
B = N.orientnew('B','Axis',[psi,N.z])
```


```python
B.dcm(N)
```




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



### V2pt_theory


```python
O = me.Point('O')
P = O.locatenew('P',10*B.x)
```


```python
O.set_vel(N,x0*N.x + y0*N.y)
```


```python
P.v2pt_theory(O,N,B)
```




$\displaystyle 10 \dot{\psi}\mathbf{\hat{b}_y} + x_{0}\mathbf{\hat{n}_x} + y_{0}\mathbf{\hat{n}_y}$




```python
P.vel(N).to_matrix(N)
```




$\displaystyle \left[\begin{matrix}\operatorname{x_{0}}{\left(t \right)} - 10 \sin{\left(\psi{\left(t \right)} \right)} \frac{d}{d t} \psi{\left(t \right)}\\\operatorname{y_{0}}{\left(t \right)} + 10 \cos{\left(\psi{\left(t \right)} \right)} \frac{d}{d t} \psi{\left(t \right)}\\0\end{matrix}\right]$



### V1pt_theory


```python
O = me.Point('O')
P = O.locatenew('P',0)
```


```python
O.set_vel(N,0)
P.set_vel(B,u*B.x + v*B.y)
```


```python
P.v1pt_theory(O,N,B)
```




$\displaystyle u\mathbf{\hat{b}_x} + v\mathbf{\hat{b}_y}$




```python
P.vel(N).to_matrix(N)
```




$\displaystyle \left[\begin{matrix}u{\left(t \right)} \cos{\left(\psi{\left(t \right)} \right)} - v{\left(t \right)} \sin{\left(\psi{\left(t \right)} \right)}\\u{\left(t \right)} \sin{\left(\psi{\left(t \right)} \right)} + v{\left(t \right)} \cos{\left(\psi{\left(t \right)} \right)}\\0\end{matrix}\right]$



## Bludder


```python
O = me.Point('O')
O.set_vel(N,0)

P = me.Point('P')
P.set_pos(O,x0*N.x + y0*N.y)
P.set_vel(B,u*B.x + v*B.y)

P.v1pt_theory(O,N,B)
```




$\displaystyle u\mathbf{\hat{b}_x} + v\mathbf{\hat{b}_y} -  y_{0} \dot{\psi}\mathbf{\hat{n}_x} + x_{0} \dot{\psi}\mathbf{\hat{n}_y}$




```python
P.vel(N).to_matrix(N)
```




$\displaystyle \left[\begin{matrix}u{\left(t \right)} \cos{\left(\psi{\left(t \right)} \right)} - v{\left(t \right)} \sin{\left(\psi{\left(t \right)} \right)} - \operatorname{y_{0}}{\left(t \right)} \frac{d}{d t} \psi{\left(t \right)}\\u{\left(t \right)} \sin{\left(\psi{\left(t \right)} \right)} + v{\left(t \right)} \cos{\left(\psi{\left(t \right)} \right)} + \operatorname{x_{0}}{\left(t \right)} \frac{d}{d t} \psi{\left(t \right)}\\0\end{matrix}\right]$




```python

```

08136f05095ce02f5cb2d8e95aac43bc854248e5
ipynb
Jupyter Notebook
reference_frame.ipynb
axelande/rigidbodysimulator
a87c3eb3b7978ef01efca15e66a6de6518870cd8
MIT
reference_frame.ipynb
axelande/rigidbodysimulator
a87c3eb3b7978ef01efca15e66a6de6518870cd8
MIT
2020-10-26T19:47:02.000Z
2020-10-26T19:47:02.000Z
reference_frame.ipynb
axelande/rigidbodysimulator
a87c3eb3b7978ef01efca15e66a6de6518870cd8
MIT
2020-10-26T09:17:00.000Z
2020-10-26T09:17:00.000Z
Qwen/Qwen-72B
1. YES
2. YES