(yaw, pitch, roll)
| 75 | |
| 76 | |
| 77 | def 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 | |
| 99 | def pick_colors(): |
no outgoing calls
no test coverage detected