08-Oct-2025 14:14:54 quaternions_test(): MATLAB/Octave version 6.4.0 Test quaternions() degrees_to_radians_test(): degrees_to_radians() converts an angle from degrees to radians; Degrees Radians Degrees -60.000000 -1.047198 -60.000000 -30.000000 -0.523599 -30.000000 0.000000 0.000000 0.000000 30.000000 0.523599 30.000000 60.000000 1.047198 60.000000 90.000000 1.570796 90.000000 120.000000 2.094395 120.000000 150.000000 2.617994 150.000000 180.000000 3.141593 180.000000 210.000000 3.665191 210.000000 240.000000 4.188790 240.000000 270.000000 4.712389 270.000000 300.000000 5.235988 300.000000 330.000000 5.759587 330.000000 360.000000 6.283185 360.000000 390.000000 6.806784 390.000000 420.000000 7.330383 420.000000 q8_conjugate_test(): q8_conjugate() conjugates a quaternion; q1 = q8_normal_01 ( ): 0.339961 -0.354942 -0.666272 1.75066 q2 = q8_conjugate ( q1 ): 0.339961 0.354942 0.666272 -1.75066 q1 = q8_normal_01 ( ): 1.14938 -0.875536 -2.21727 0.88873 q2 = q8_conjugate ( q1 ): 1.14938 0.875536 2.21727 -0.88873 q1 = q8_normal_01 ( ): -1.06134 1.10642 -0.228019 0.0564905 q2 = q8_conjugate ( q1 ): -1.06134 -1.10642 0.228019 -0.0564905 q1 = q8_normal_01 ( ): -0.812511 1.04908 -1.6639 -0.873538 q2 = q8_conjugate ( q1 ): -0.812511 -1.04908 1.6639 0.873538 q1 = q8_normal_01 ( ): 0.564589 -1.62935 -0.821381 -0.939411 q2 = q8_conjugate ( q1 ): 0.564589 1.62935 0.821381 0.939411 q8_exponentiate_test(): q8_exponentiate() exponentiates a quaternion; q1 = q8_normal_01 ( ): 0.191024 -0.0128113 -0.86101 1.28454 q2 = q8_exponentiate ( q1 ): 0.0294487 -0.010025 -0.673752 1.00517 q1 = q8_normal_01 ( ): -0.328308 0.901468 0.969714 0.223826 q2 = q8_exponentiate ( q1 ): 0.162777 0.470946 0.5066 0.116932 q1 = q8_normal_01 ( ): -0.0546025 -1.96157 -0.785697 -0.498785 q2 = q8_exponentiate ( q1 ): -0.534912 -0.705876 -0.282735 -0.179489 q1 = q8_normal_01 ( ): 0.0577571 -0.625828 -0.117103 -0.172388 q2 = q8_exponentiate ( q1 ): 0.837214 -0.615993 -0.115262 -0.169679 q1 = q8_normal_01 ( ): -0.1438 0.802528 -0.630187 -0.0515313 q2 = q8_exponentiate ( q1 ): 0.452022 0.580276 -0.455663 -0.0372603 q8_inverse_test(): q8_inverse() inverts a quaternion; q1 = q8_normal_01 ( ): -1.54271 1.02424 -0.170909 -0.0747438 q2 = q8_inverse ( q1 ): -0.445379 -0.295697 0.0493415 0.0215785 q3 = q8_multiply ( q1, q2 ): 1 4.33681e-19 3.46945e-18 6.93889e-18 q1 = q8_normal_01 ( ): 0.416973 -0.40156 1.15647 -0.489155 q2 = q8_inverse ( q1 ): 0.218103 0.210041 -0.604907 0.255859 q3 = q8_multiply ( q1, q2 ): 1 0 -4.16334e-17 5.55112e-17 q1 = q8_normal_01 ( ): 0.83093 0.667044 0.327916 1.29053 q2 = q8_inverse ( q1 ): 0.285702 -0.229352 -0.112749 -0.443727 q3 = q8_multiply ( q1, q2 ): 1 2.77556e-17 0 0 q1 = q8_normal_01 ( ): -0.780113 -0.813814 1.70043 0.152707 q2 = q8_inverse ( q1 ): -0.186378 0.19443 -0.406252 -0.0364835 q3 = q8_multiply ( q1, q2 ): 1 6.93889e-18 -3.46945e-18 1.38778e-17 q1 = q8_normal_01 ( ): -1.56531 0.491295 0.0708792 -0.516965 q2 = q8_inverse ( q1 ): -0.528134 -0.165762 -0.0239145 0.174423 q3 = q8_multiply ( q1, q2 ): 1 5.37764e-17 0 0 q8_multiply_test(): q8_multiply() multiplies two quaternions; q1 = q8_normal_01 ( ) : -0.354007 0.0250061 -0.886112 -0.18976 q2 = q8_normal_01 ( ) : 0.633588 0.471364 -0.838794 -0.884087 q3 = q8_multiply ( q1, q2 ): -1.14711 0.473208 -0.33183 0.589449 q1 = q8_normal_01 ( ) : -1.08806 -0.391439 -0.394599 -1.14284 q2 = q8_normal_01 ( ) : 0.963294 0.0586729 0.0519153 0.185269 q3 = q8_multiply ( q1, q2 ): -0.792935 -0.454686 -0.431134 -1.29965 q1 = q8_normal_01 ( ) : 0.624787 -0.513192 0.819606 0.253282 q2 = q8_normal_01 ( ) : 0.205154 0.235105 -0.890396 -1.78049 q3 = q8_multiply ( q1, q2 ): 1.42957 -1.19217 -1.24235 -0.796213 q1 = q8_normal_01 ( ) : -0.534188 1.0311 -0.426909 0.133676 q2 = q8_normal_01 ( ) : 0.360663 0.845811 -0.825274 -0.429561 q3 = q8_multiply ( q1, q2 ): -1.35967 0.21376 0.842864 -0.212174 q1 = q8_normal_01 ( ) : 0.239197 -1.24767 1.39668 0.128657 q2 = q8_normal_01 ( ) : 1.09559 -0.231205 0.720407 -0.549978 q3 = q8_multiply ( q1, q2 ): -0.961826 -2.28307 0.986581 -0.566505 q8_multiply2_test(): q8_multiply2() multiplies two quaternions using a matrix; q1 = q8_normal_01 ( ) : 0.084963 -0.527531 0.711041 2.59762 q2 = q8_normal_01 ( ) : 0.167162 -1.40032 0.317525 0.302187 q3 = q8_multiply2 ( q1, q2 ): -1.73525 -0.817102 -3.33225 1.28808 q1 = q8_normal_01 ( ) : 0.196737 -0.839378 0.134321 0.318234 q2 = q8_normal_01 ( ) : -1.03045 -0.817266 1.20095 0.369904 q3 = q8_multiply2 ( q1, q2 ): -1.16775 0.371649 0.148268 -1.15343 q1 = q8_normal_01 ( ) : 0.482471 1.33533 -0.585255 0.729953 q2 = q8_normal_01 ( ) : -0.294799 0.31444 0.608398 -1.24824 q3 = q8_multiply2 ( q1, q2 ): 0.705113 0.0444923 2.36241 0.17901 q1 = q8_normal_01 ( ) : 0.611152 -0.777122 -1.06056 -1.23257 q2 = q8_normal_01 ( ) : -0.487737 0.569997 1.3806 0.168233 q3 = q8_multiply2 ( q1, q2 ): 1.81645 2.25065 0.789205 0.235614 q1 = q8_normal_01 ( ) : 0.21633 -0.105683 -0.325518 -0.0308316 q2 = q8_normal_01 ( ) : 1.6236 0.799503 -0.0673652 1.72271 q3 = q8_multiply2 ( q1, q2 ): 0.466914 -0.561482 -0.385673 0.589988 q8_norm_test() q8_norm() computes the norm of a quaternion. q = q8_normal_01(): -0.944384 -1.14794 1.48691 -1.73512 q8_norm(q) = 2.72602 q = q8_normal_01(): -0.22909 -0.480713 0.924018 -0.13754 q8_norm(q) = 1.07531 q = q8_normal_01(): 0.556334 0.345763 -0.55922 -0.219399 q8_norm(q) = 0.888776 q = q8_normal_01(): -0.726231 -2.10233 -0.0518151 0.118158 q8_norm(q) = 2.22797 q = q8_normal_01(): 0.79092 0.015162 -0.06955 -0.643487 q8_norm(q) = 1.0221 q8_normal_01_test() q8_normal_01() computes a normally distributed quaternion. Sample #1 0.171727 0.124931 -1.37339 0.133286 Sample #2 -0.202794 -0.735946 -0.677883 1.32462 Sample #3 1.40289 -0.873839 0.409118 0.355939 Sample #4 0.173219 1.14992 1.64049 0.376695 Sample #5 -0.34288 -0.724984 -0.922974 1.13494 q8_transpose_print_test(): q8_transpose_print() prints a quaternion "transposed", that is, writing it as a row vector. The quaternion: 1.02576 0.850395 -0.987485 0.893081 radians_to_degrees_test(): radians_to_degrees() converts an angle from radians to degrees; Degrees Radians Degrees -60.000000 -1.047198 -60.000000 -30.000000 -0.523599 -30.000000 0.000000 0.000000 0.000000 30.000000 0.523599 30.000000 60.000000 1.047198 60.000000 90.000000 1.570796 90.000000 120.000000 2.094395 120.000000 150.000000 2.617994 150.000000 180.000000 3.141593 180.000000 210.000000 3.665191 210.000000 240.000000 4.188790 240.000000 270.000000 4.712389 270.000000 300.000000 5.235988 300.000000 330.000000 5.759587 330.000000 360.000000 6.283185 360.000000 390.000000 6.806784 390.000000 420.000000 7.330383 420.000000 rotation_axis_vector_test(): rotation_axis_vector() applies an axis rotation to a vector; The vector: 1: 1 2: 4 3: 10 The rotation axis: 1: 0.236174 2: -0.881412 3: -0.409065 The rotation angle is 1.159804 The rotated vector: 1: -7.22724 2: 2.9641 3: 7.48205 The vector: 1: 1 2: 1 3: 1 The rotation axis: 1: 0 2: 0 3: 2 The rotation angle is 1.570796 The rotated vector: 1: -1 2: 1 3: 1 rotation_axis2mat_test(): rotation_axis2mat() converts a rotation axis to a matrix. The vector V: 1: 1 2: 4 3: 10 The rotation axis: 1: 0.236174 2: -0.881412 3: -0.409065 The rotation angle is 1.159804 The rotation matrix A: Col: 1 2 3 Row 1 : 0.433013 0.25 -0.866025 2 : -0.5 0.866025 -1.04741e-08 3 : 0.75 0.433013 0.5 The rotated vector W = A * V: 1: -7.22724 2: 2.9641 3: 7.48205 The vector V: 1: 1 2: 1 3: 1 The rotation axis: 1: 0 2: 0 3: 2 The rotation angle is 1.570796 The rotation matrix A: Col: 1 2 3 Row 1 : 6.12323e-17 -1 0 2 : 1 6.12323e-17 0 3 : 0 0 1 The rotated vector W = A * V: 1: -1 2: 1 3: 1 rotation_axis2quat_test(): rotation_axis2quat() converts a rotation axis to a quaternion. The vector V: 1: 1 2: 4 3: 10 The rotation axis: 1: 0.236174 2: -0.881412 3: -0.409065 The rotation angle is 1.159804 The rotation quaternion Q: 1: 0.836516 2: 0.129409 3: -0.482963 4: -0.224144 The rotated vector W: 1: -7.22724 2: 2.9641 3: 7.48205 The vector V: 1: 1 2: 1 3: 1 The rotation axis: 1: 0 2: 0 3: 2 The rotation angle is 1.570796 The rotation quaternion Q: 1: 0.707107 2: 0 3: 0 4: 0.707107 The rotated vector W: 1: -1 2: 1 3: 1 rotation_mat_vector_test(): rotation_mat_vector() applies a matrix rotation to a vector. The rotation matrix: Col: 1 2 3 Row 1 : 0.433013 0.25 -0.866025 2 : -0.5 0.866025 0 3 : 0.75 0.433013 0.5 The vector V: 1: 1 2: 4 3: 10 The rotated vector W = A * V: 1: -7.22724 2: 2.9641 3: 7.48205 rotation_mat2axis_test() rotation_mat2axis() computes a rotation axis and angle from a rotation matrix. rotation_axis2mat() computes a rotation matrix from a rotation axis and angle. The rotation matrix: Col: 1 2 3 Row 1 : 0.433013 0.25 -0.866025 2 : -0.5 0.866025 0 3 : 0.75 0.433013 0.5 The rotation axis: 1: 0.236174 2: -0.881412 3: -0.409065 The rotation angle is 1.159804 The recovered rotation matrix: Col: 1 2 3 Row 1 : 0.433013 0.25 -0.866025 2 : -0.5 0.866025 9.17325e-09 3 : 0.75 0.433013 0.5 rotation_mat2quat_test(): rotation_mat2quat() computes a quaternion from a rotation matrix. rotation_quat2mat() computes a rotation matrix from a quaternion. The rotation matrix: Col: 1 2 3 Row 1 : 0.433013 0.25 -0.866025 2 : -0.5 0.866025 0 3 : 0.75 0.433013 0.5 The rotation quaternion Q: 1: 0.836516 2: 0.12941 3: -0.482963 4: -0.224144 The recovered rotation matrix: Col: 1 2 3 Row 1 : 0.433013 0.25 -0.866025 2 : -0.5 0.866025 9.17325e-09 3 : 0.75 0.433013 0.5 rotation_quat_vector_test(): rotation_quat_vector() applies a quaternion rotation to a vector. The rotation quaternion: 1: 0.836516 2: 0.12941 3: -0.482963 4: -0.224144 The vector V: 1: 1 2: 4 3: 10 The rotated vector: 1: -7.22724 2: 2.96409 3: 7.48204 rotation_quat2axis_test(): rotation_quat2axis() computes a rotation axis and angle from a rotation quaternion. rotation_axis2quat() computes a rotation quaternion from a rotation axis and angle. The rotation quaternion: 1: 0.836516 2: 0.12941 3: -0.482963 4: -0.224144 The rotation axis: 1: 0.236175 2: -0.881412 3: -0.409065 The rotation angle is 1.159805 The recovered rotation quaternion: 1: 0.836516 2: 0.12941 3: -0.482963 4: -0.224144 rotation_quat2mat_test(): rotation_quat2mat() computes a rotation axis from a rotation quaternion. rotation_mat2quat() computes a rotation quaternion from a rotation matrix. The rotation quaternion: 1: 0.836516 2: 0.12941 3: -0.482963 4: -0.224144 The rotation matrix: Col: 1 2 3 Row 1 : 0.433012 0.25 -0.866026 2 : -0.500001 0.866025 -5.53776e-07 3 : 0.75 0.433014 0.499999 The recovered rotation quaternion: 1: 0.836516 2: 0.12941 3: -0.482963 4: -0.224144 rotation_xyz_test(): rotation_xyz() rotates an xyz point through an angle of theta radians around an axis vector using quaternion multiplication. The rotation axis: 1: 0.154701 2: -0.577351 3: -0.267949 The rotation angle (degrees): 66.4519 The point xyz: 1: 1 2: 4 3: 10 The rotated point: 1: -7.22725 2: 2.96409 3: 7.48205 quaternions_test(): Normal end of execution. 08-Oct-2025 14:14:54