06-May-2023 18:17:34 quaternions_test(): MATLAB/Octave version 5.2.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.0493687 -0.14925 -2.57139 -0.968042 q2 = q8_conjugate ( q1 ): 0.0493687 0.14925 2.57139 0.968042 q1 = q8_normal_01 ( ): 1.89673 0.0302673 -1.24267 -0.0510473 q2 = q8_conjugate ( q1 ): 1.89673 -0.0302673 1.24267 0.0510473 q1 = q8_normal_01 ( ): -1.43038 0.876929 -0.995028 -0.106826 q2 = q8_conjugate ( q1 ): -1.43038 -0.876929 0.995028 0.106826 q1 = q8_normal_01 ( ): -0.759473 2.05416 -0.378054 0.0940186 q2 = q8_conjugate ( q1 ): -0.759473 -2.05416 0.378054 -0.0940186 q1 = q8_normal_01 ( ): 0.352223 0.71651 1.01876 0.0782534 q2 = q8_conjugate ( q1 ): 0.352223 -0.71651 -1.01876 -0.0782534 q8_exponentiate_test(): q8_exponentiate() exponentiates a quaternion; q1 = q8_normal_01 ( ): 0.264805 -0.236682 1.39967 -1.75029 q2 = q8_exponentiate ( q1 ): -0.822238 -0.106184 0.627942 -0.785244 q1 = q8_normal_01 ( ): -0.306999 0.441954 -0.523022 -0.807074 q2 = q8_exponentiate ( q1 ): 0.360655 0.267732 -0.316842 -0.488918 q1 = q8_normal_01 ( ): 0.112225 -0.384071 0.0859782 -0.322329 q2 = q8_exponentiate ( q1 ): 0.977093 -0.41139 0.0920938 -0.345256 q1 = q8_normal_01 ( ): 0.621787 0.226187 -0.732245 0.75153 q2 = q8_exponentiate ( q1 ): 0.888588 0.344868 -1.11645 1.14586 q1 = q8_normal_01 ( ): 0.56628 -0.905866 1.17046 -0.0431197 q2 = q8_exponentiate ( q1 ): 0.15853 -1.07341 1.38695 -0.0510951 q8_inverse_test(): q8_inverse() inverts a quaternion; q1 = q8_normal_01 ( ): -0.410499 1.04891 1.29739 0.633348 q2 = q8_inverse ( q1 ): -0.122424 -0.31282 -0.386925 -0.188885 q3 = q8_multiply ( q1, q2 ): 1 -2.77556e-17 0 -8.32667e-17 q1 = q8_normal_01 ( ): -0.841441 0.464285 0.410066 0.962467 q2 = q8_inverse ( q1 ): -0.416951 -0.230062 -0.203196 -0.476922 q3 = q8_multiply ( q1, q2 ): 1 -2.77556e-17 0 -5.55112e-17 q1 = q8_normal_01 ( ): -0.0240479 -0.904654 0.235679 -1.14709 q2 = q8_inverse ( q1 ): -0.010979 0.413019 -0.107599 0.523704 q3 = q8_multiply ( q1, q2 ): 1 -1.38778e-17 0 1.21431e-17 q1 = q8_normal_01 ( ): 0.596182 -0.45459 0.178655 -0.503496 q2 = q8_inverse ( q1 ): 0.703451 0.536383 -0.2108 0.594088 q3 = q8_multiply ( q1, q2 ): 1 0 0 -5.55112e-17 q1 = q8_normal_01 ( ): 0.75846 -0.522881 1.05812 -1.5037 q2 = q8_inverse ( q1 ): 0.17933 0.12363 -0.250182 0.355535 q3 = q8_multiply ( q1, q2 ): 1 0 0 0 q8_multiply_test(): q8_multiply() multiplies two quaternions; q1 = q8_normal_01 ( ) : -0.180809 0.107594 0.306942 1.0386 q2 = q8_normal_01 ( ) : -1.073 -1.57238 -0.824976 0.554321 q3 = q8_multiply ( q1, q2 ): 0.0406881 1.19582 -1.8729 -0.820778 q1 = q8_normal_01 ( ) : 0.625053 -1.67602 -0.333599 -0.0502902 q2 = q8_normal_01 ( ) : 0.830309 -1.68386 1.53303 -0.0749954 q3 = q8_multiply ( q1, q2 ): -1.79555 -2.342 0.640226 -3.21976 q1 = q8_normal_01 ( ) : 1.62617 0.219348 0.50904 0.230287 q2 = q8_normal_01 ( ) : -1.02872 -0.274842 -0.63929 0.160974 q3 = q8_multiply ( q1, q2 ): -1.32423 -0.443423 -1.66185 0.0245476 q1 = q8_normal_01 ( ) : 0.814398 -1.50194 0.679652 0.905593 q2 = q8_normal_01 ( ) : 0.987249 -0.562678 0.530932 0.703457 q3 = q8_multiply ( q1, q2 ): -1.03899 -1.94373 1.65037 1.05194 q1 = q8_normal_01 ( ) : 0.186277 0.0459447 -0.245529 1.30225 q2 = q8_normal_01 ( ) : 0.110943 -0.479604 -0.00807881 0.685546 q3 = q8_multiply ( q1, q2 ): -0.852032 -0.242043 -0.684805 0.154049 q8_multiply2_test(): q8_multiply2() multiplies two quaternions using a matrix; q1 = q8_normal_01 ( ) : -0.178986 -0.539115 1.90132 -0.488465 q2 = q8_normal_01 ( ) : 0.823374 -1.20196 -0.495239 -0.747399 q3 = q8_multiply2 ( q1, q2 ): -0.218838 -1.89171 1.83832 2.28389 q1 = q8_normal_01 ( ) : -0.68637 0.915392 -0.590269 2.01424 q2 = q8_normal_01 ( ) : 0.512671 0.296719 -1.51931 0.937898 q3 = q8_multiply2 ( q1, q2 ): -3.40945 2.77228 0.479315 -0.826721 q1 = q8_normal_01 ( ) : -1.78982 0.23165 -0.72933 -0.0936298 q2 = q8_normal_01 ( ) : 0.525933 1.31647 -0.162582 0.387871 q3 = q8_multiply2 ( q1, q2 ): -1.32855 -2.53252 -0.305697 0.179015 q1 = q8_normal_01 ( ) : 0.889873 0.24981 0.555966 -0.217234 q2 = q8_normal_01 ( ) : 1.80328 -1.1763 -0.343706 0.676502 q3 = q8_multiply2 ( q1, q2 ): 2.23659 -0.294834 0.783245 0.778389 q1 = q8_normal_01 ( ) : 0.356436 0.447476 0.0692802 -1.07207 q2 = q8_normal_01 ( ) : 0.712315 -2.58343 -0.255873 -1.66619 q3 = q8_multiply2 ( q1, q2 ): -0.358626 -0.991829 3.47333 -1.29306 q8_norm_test() q8_norm() computes the norm of a quaternion. q = q8_normal_01(): 0.81563 -0.61329 -1.4285 -0.427366 q8_norm(q) = 1.80683 q = q8_normal_01(): -0.262373 0.980964 0.231296 1.68628 q8_norm(q) = 1.98196 q = q8_normal_01(): -1.96967 0.565606 0.645017 -1.03213 q8_norm(q) = 2.38346 q = q8_normal_01(): -0.678637 0.550477 0.563445 -0.0457037 q8_norm(q) = 1.04074 q = q8_normal_01(): -1.5743 1.88815 -0.871873 -0.355362 q8_norm(q) = 2.63249 q8_normal_01_test() q8_normal_01() computes a normally distributed quaternion. Sample #1 0.373632 0.776631 0.292118 -1.0082 Sample #2 0.245926 -1.45084 0.077444 -1.35623 Sample #3 -1.99855 -1.01806 -0.0416746 -0.335576 Sample #4 -0.831705 0.277221 0.334403 -2.74179 Sample #5 -0.256189 -2.30158 -1.29165 -1.17673 q8_transpose_print_test(): q8_transpose_print() prints a quaternion "transposed", that is, writing it as a row vector. The quaternion: 2.05888 -0.710708 1.15802 1.10138 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. 06-May-2023 18:17:34