Insignificant style edit

This commit is contained in:
Grant Sanderson 2020-02-20 15:51:26 -08:00
parent 16ea2a0104
commit ec017bd1ae

View file

@ -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)