HOW IT ALL WORKS

Briefly, the way arcball works is as follows:

SOME THEORY

The space of unit quaternions is a sphere in (set of points with ) with a multiplication rule (which we describe later).

There is a homomorphism (in fact, a double cover) from the space of unit quaternions to the space of rotations. What this means is that you can think of quaternion multiplication as composition of rotations; in practical terms, this accounts for the fact that the Arcball interface is path-independent (closed loops result in no rotation).

The homomorphism is as follows:

rotation about the axis by angle 2α

It is therefore convinient to store quaternion as a pair of a scalar and a vector; so we have

rotation about the axis by angle 2α

Note that the quaternions and correspond to the same rotation, and that these are the only unit quaternions corresponding to that rotation; any rotation in corresponds to exactly two quaternions in this way (hence the term "double cover").

Thus, the quaternion corresponding to rotating the vector to vector on the unit sphere (but by twice the angle between u and v) is

The multiplication of quaternions can be defined in terms of these parts:

.

One can derive this formula starting from another definition: write a quaternion , and then multiply quaternions using the rules and distribution laws. For the purposes of the arcball, however, this is not a convenient defintition.