-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: render rotation matrix explicitly (#180)
Co-authored-by: Mikhail Mikhasenko <[email protected]>
- Loading branch information
1 parent
65afb7b
commit eaf8c59
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Explicit rotation matrix" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"```{autolink-concat}\n", | ||
"```" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"tags": [ | ||
"hide-input" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import sympy as sp\n", | ||
"\n", | ||
"\n", | ||
"def Rz(α):\n", | ||
" return sp.Matrix(\n", | ||
" [\n", | ||
" [sp.cos(α), -sp.sin(α), 0],\n", | ||
" [sp.sin(α), sp.cos(α), 0],\n", | ||
" [0, 0, 1],\n", | ||
" ]\n", | ||
" )\n", | ||
"\n", | ||
"\n", | ||
"def Ry(α):\n", | ||
" return sp.Matrix(\n", | ||
" [\n", | ||
" [sp.cos(α), 0, sp.sin(α)],\n", | ||
" [0, 1, 0],\n", | ||
" [-sp.sin(α), 0, sp.cos(α)],\n", | ||
" ]\n", | ||
" )\n", | ||
"\n", | ||
"\n", | ||
"θ, ϕ, χ = sp.symbols(\"theta phi chi\")\n", | ||
"R = Rz(ϕ) @ Ry(θ) @ Rz(χ)\n", | ||
"R" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.13" | ||
}, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "d54b55e42db0e71aa222cee01fa24af6ccae1fbbd4d24a4dc92ca39f5243715f" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |