MCPcopy
hub / github.com/matthewearl/deep-anpr / euler_to_mat

Function euler_to_mat

gen.py:77–96  ·  view source on GitHub ↗
(yaw, pitch, roll)

Source from the content-addressed store, hash-verified

75
76
77def euler_to_mat(yaw, pitch, roll):
78 # Rotate clockwise about the Y-axis
79 c, s = math.cos(yaw), math.sin(yaw)
80 M = numpy.matrix([[ c, 0., s],
81 [ 0., 1., 0.],
82 [ -s, 0., c]])
83
84 # Rotate clockwise about the X-axis
85 c, s = math.cos(pitch), math.sin(pitch)
86 M = numpy.matrix([[ 1., 0., 0.],
87 [ 0., c, -s],
88 [ 0., s, c]]) * M
89
90 # Rotate clockwise about the Z-axis
91 c, s = math.cos(roll), math.sin(roll)
92 M = numpy.matrix([[ c, -s, 0.],
93 [ s, c, 0.],
94 [ 0., 0., 1.]]) * M
95
96 return M
97
98
99def pick_colors():

Callers 1

make_affine_transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected