19 [0.0, math.cos(roll), -math.sin(roll)],
20 [0.0, math.sin(roll), math.cos(roll)]], np.float64)
23 [math.cos(pitch), 0.0, math.sin(pitch)],
25 [-math.sin(pitch), 0.0, math.cos(pitch)]], np.float64)
28 [math.cos(yaw), -math.sin(yaw), 0.0],
29 [math.sin(yaw), math.cos(yaw), 0.0],
30 [0.0, 0.0, 1.0]], np.float64)
32 rot_3x3 = rot_z @ rot_y @ rot_x
40 cy = math.cos(yaw * 0.5);
41 sy = math.sin(yaw * 0.5);
42 cp = math.cos(pitch * 0.5);
43 sp = math.sin(pitch * 0.5);
44 cr = math.cos(roll * 0.5);
45 sr = math.sin(roll * 0.5);
46 x = sr * cp * cy - cr * sp * sy;
47 y = cr * sp * cy + sr * cp * sy;
48 z = cr * cp * sy - sr * sp * cy;
49 w = cr * cp * cy + sr * sp * sy;
53 roll, pitch, yaw = 5, -10, 15
56 print(
"roll = {}, pitch = {}, yaw = {}:\nrot3x3 = {}\nquaternion = {}".format(roll, pitch, yaw, rot3x3, quat))