First, what does the angle between two four-dimensional vectors (= quaternions) mean geometrically for you? You can calculate it, but the result may not make sense. Maybe you are looking for the angle between the axis of rotation, which is represented by two quaternions?
Secondly, there is an error:
float radAngle = (float)(2.0 * Math.acos(Quaternion.dot(qmv2, qnil))); ^^^^^
The result from acos is the angle. Do not multiply by 2.
Thirdly, the angle between two vectors in three-dimensional or 4D-space can never exceed 180 Β°. On the plane, this can be because the plane imposes an orientation. In three-dimensional space, you will need to define an arbitrary direction as βupβ to get angles above 180 Β°.
source share