mirror of
https://github.com/3b1b/manim.git
synced 2025-08-19 21:08:53 +00:00
Insignificant style edit
This commit is contained in:
parent
16ea2a0104
commit
ec017bd1ae
1 changed files with 5 additions and 5 deletions
|
@ -82,13 +82,13 @@ def thick_diagonal(dim, thickness=2):
|
||||||
def rotation_matrix_transpose(angle, axis):
|
def rotation_matrix_transpose(angle, axis):
|
||||||
if axis[0] == 0 and axis[1] == 0:
|
if axis[0] == 0 and axis[1] == 0:
|
||||||
# axis = [0, 0, z] case is common enough it's worth
|
# axis = [0, 0, z] case is common enough it's worth
|
||||||
# having a shortcut to save operations
|
# having a shortcut
|
||||||
sgn = 1 if axis[2] > 0 else -1
|
sgn = 1 if axis[2] > 0 else -1
|
||||||
ca = np.cos(angle)
|
cos_a = np.cos(angle)
|
||||||
sa = np.sin(angle)
|
sin_a = np.sin(angle) * sgn
|
||||||
return [
|
return [
|
||||||
[ca, sgn * sa, 0],
|
[cos_a, sin_a, 0],
|
||||||
[-sgn * sa, ca, 0],
|
[-sin_a, cos_a, 0],
|
||||||
[0, 0, 1],
|
[0, 0, 1],
|
||||||
]
|
]
|
||||||
quat = quaternion_from_angle_axis(angle, axis)
|
quat = quaternion_from_angle_axis(angle, axis)
|
||||||
|
|
Loading…
Add table
Reference in a new issue