Skip to content
Snippets Groups Projects
Unverified Commit eaf8c59d authored by Remco de Boer's avatar Remco de Boer Committed by GitHub
Browse files

DOC: render rotation matrix explicitly (#180)


Co-authored-by: default avatarMikhail Mikhasenko <mikhail.mikhasenko@cern.ch>
parent 65afb7b4
No related branches found
Tags 0.0.2
No related merge requests found
Pipeline #4521291 passed with stages
in 1 hour, 19 minutes, and 39 seconds
......@@ -3,6 +3,7 @@
```{toctree}
appendix/dynamics
appendix/angles
appendix/rotation-matrix
appendix/phase-space
appendix/alignment
appendix/benchmark
......
%% Cell type:markdown id: tags:
# Explicit rotation matrix
%% Cell type:markdown id: tags:
```{autolink-concat}
```
%% Cell type:code id: tags:hide-input
``` python
import sympy as sp
def Rz(α):
return sp.Matrix(
[
[sp.cos(α), -sp.sin(α), 0],
[sp.sin(α), sp.cos(α), 0],
[0, 0, 1],
]
)
def Ry(α):
return sp.Matrix(
[
[sp.cos(α), 0, sp.sin(α)],
[0, 1, 0],
[-sp.sin(α), 0, sp.cos(α)],
]
)
θ, ϕ, χ = sp.symbols("theta phi chi")
R = Rz(ϕ) @ Ry(θ) @ Rz(χ)
R
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment