15-May-2025 20:33:56 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.504089 -0.568575 0.141743 0.521653 q2 = q8_conjugate ( q1 ): -0.504089 0.568575 -0.141743 -0.521653 q1 = q8_normal_01 ( ): -2.3037 -2.52515 1.09291 2.00187 q2 = q8_conjugate ( q1 ): -2.3037 2.52515 -1.09291 -2.00187 q1 = q8_normal_01 ( ): -1.25881 -0.0736042 -0.0477026 0.731342 q2 = q8_conjugate ( q1 ): -1.25881 0.0736042 0.0477026 -0.731342 q1 = q8_normal_01 ( ): 0.112114 -0.360874 1.24567 -0.0604223 q2 = q8_conjugate ( q1 ): 0.112114 0.360874 -1.24567 0.0604223 q1 = q8_normal_01 ( ): 0.0236996 -1.02663 1.82761 -0.412233 q2 = q8_conjugate ( q1 ): 0.0236996 1.02663 -1.82761 0.412233 q8_exponentiate_test(): q8_exponentiate() exponentiates a quaternion; q1 = q8_normal_01 ( ): -0.644489 -1.53936 0.395491 -0.564337 q2 = q8_exponentiate ( q1 ): -0.0606393 -0.475905 0.122269 -0.174469 q1 = q8_normal_01 ( ): -0.46765 -0.832618 0.643503 -0.94983 q2 = q8_exponentiate ( q1 ): 0.0956124 -0.36365 0.281053 -0.414842 q1 = q8_normal_01 ( ): -0.20094 -0.142481 1.39513 -0.817143 q2 = q8_exponentiate ( q1 ): -0.0427515 -0.0717059 0.702121 -0.41124 q1 = q8_normal_01 ( ): -0.473573 0.758051 -0.0873742 0.00293919 q2 = q8_exponentiate ( q1 ): 0.450087 0.427594 -0.0492852 0.00165791 q1 = q8_normal_01 ( ): 1.62918 0.141936 0.60047 -0.0233309 q2 = q8_exponentiate ( q1 ): 4.15806 0.678709 2.87132 -0.111563 q8_inverse_test(): q8_inverse() inverts a quaternion; q1 = q8_normal_01 ( ): -0.615241 -1.6358 1.13446 -0.879792 q2 = q8_inverse ( q1 ): -0.120272 0.319779 -0.221774 0.171988 q3 = q8_multiply ( q1, q2 ): 1 2.77556e-17 5.55112e-17 5.55112e-17 q1 = q8_normal_01 ( ): 0.824145 -0.0413779 0.916207 -0.980345 q2 = q8_inverse ( q1 ): 0.332124 0.016675 -0.369224 0.395071 q3 = q8_multiply ( q1, q2 ): 1 0 3.1225e-17 0 q1 = q8_normal_01 ( ): -0.178341 -0.0374717 1.59614 -0.591574 q2 = q8_inverse ( q1 ): -0.0608501 0.0127854 -0.544604 0.201846 q3 = q8_multiply ( q1, q2 ): 1 0 9.54098e-18 0 q1 = q8_normal_01 ( ): -0.06653 -0.668637 -0.687692 -1.29072 q2 = q8_inverse ( q1 ): -0.0256834 0.258122 0.265478 0.498274 q3 = q8_multiply ( q1, q2 ): 1 0 -5.55112e-17 -6.93889e-18 q1 = q8_normal_01 ( ): -0.348812 -1.06766 -1.27561 0.176275 q2 = q8_inverse ( q1 ): -0.119464 0.365661 0.43688 -0.0603722 q3 = q8_multiply ( q1, q2 ): 1 2.77556e-17 -1.38778e-17 -4.85723e-17 q8_multiply_test(): q8_multiply() multiplies two quaternions; q1 = q8_normal_01 ( ) : 0.491803 0.617056 -0.51662 -0.365619 q2 = q8_normal_01 ( ) : -1.071 0.605161 1.6262 -0.771481 q3 = q8_multiply ( q1, q2 ): -0.342084 0.629882 1.60786 1.32826 q1 = q8_normal_01 ( ) : 0.705893 1.73033 0.0713479 -1.79183 q2 = q8_normal_01 ( ) : -2.20078 1.43158 1.3586 -0.581427 q3 = q8_multiply ( q1, q2 ): -5.16937 -0.404663 -0.757067 5.78167 q1 = q8_normal_01 ( ) : 0.926365 0.552945 -0.186538 1.08338 q2 = q8_normal_01 ( ) : -0.46951 1.0617 -2.57859 -0.624783 q3 = q8_multiply ( q1, q2 ): -0.826129 3.63404 -0.805449 -2.31521 q1 = q8_normal_01 ( ) : 0.233222 1.40365 1.50676 -1.1617 q2 = q8_normal_01 ( ) : -1.51381 0.196257 1.85946 0.980502 q3 = q8_multiply ( q1, q2 ): -2.29124 1.55843 -3.45155 4.30159 q1 = q8_normal_01 ( ) : -0.534965 -0.350188 0.0109996 0.318032 q2 = q8_normal_01 ( ) : 0.837157 -0.195517 0.570253 0.0153717 q3 = q8_multiply ( q1, q2 ): -0.527478 -0.369758 -0.352655 0.0604744 q8_multiply2_test(): q8_multiply2() multiplies two quaternions using a matrix; q1 = q8_normal_01 ( ) : -0.212031 1.40315 1.0753 -0.495252 q2 = q8_normal_01 ( ) : -1.19694 1.09851 1.4371 -0.553316 q3 = q8_multiply2 ( q1, q2 ): -3.10692 -1.79565 -1.35943 1.54534 q1 = q8_normal_01 ( ) : 1.89783 0.840283 0.432255 -0.910301 q2 = q8_normal_01 ( ) : 0.879547 -0.610399 0.102879 0.639785 q3 = q8_multiply2 ( q1, q2 ): 2.72007 -0.0491648 0.593482 0.763848 q1 = q8_normal_01 ( ) : 0.410649 -0.020716 -0.56148 1.97234 q2 = q8_normal_01 ( ) : -0.148474 -1.23973 -1.98615 -1.88757 q3 = q8_multiply2 ( q1, q2 ): 2.52111 4.47118 -3.21653 -1.72291 q1 = q8_normal_01 ( ) : -0.435419 -0.841292 -1.75629 0.401489 q2 = q8_normal_01 ( ) : -0.102437 -0.913999 -0.743542 0.128292 q3 = q8_multiply2 ( q1, q2 ): -2.08172 0.557358 0.244633 -1.0767 q1 = q8_normal_01 ( ) : -1.56292 -1.23192 0.796526 1.8413 q2 = q8_normal_01 ( ) : -0.688857 -1.02686 0.102567 -0.51683 q3 = q8_multiply2 ( q1, q2 ): 0.681565 1.85299 -3.23645 0.230937 q8_norm_test() q8_norm() computes the norm of a quaternion. q = q8_normal_01(): 0.0970264 0.105269 -1.28948 1.36277 q8_norm(q) = 1.88159 q = q8_normal_01(): -1.3095 -0.211585 -0.150915 -0.236588 q8_norm(q) = 1.35584 q = q8_normal_01(): -0.617641 1.01053 -0.730875 -1.69546 q8_norm(q) = 2.19349 q = q8_normal_01(): -0.458062 0.588118 1.20376 -0.865053 q8_norm(q) = 1.65923 q = q8_normal_01(): 0.142984 -0.805881 -1.85844 -2.67762 q8_norm(q) = 3.36056 q8_normal_01_test() q8_normal_01() computes a normally distributed quaternion. Sample #1 -0.859451 -0.392618 -0.629025 0.583978 Sample #2 -1.5668 -2.18247 0.91175 -0.779797 Sample #3 -0.292472 -0.668857 1.57561 -0.34201 Sample #4 -0.90176 0.835825 0.195331 0.255547 Sample #5 -0.000418797 -0.747299 0.630542 -0.474725 q8_transpose_print_test(): q8_transpose_print() prints a quaternion "transposed", that is, writing it as a row vector. The quaternion: 0.21037 -0.376985 -1.49268 0.0676827 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. 15-May-2025 20:33:56