Spherical (geodesic or intrinsic) mean
y = spherical_mean(q, t)
spherical_mean(q, t) computes a quaternion (full or pure according as to whether q is full or pure) which is the geodesic mean of the quaternions in vector q. t is a tolerance (0 ≤ t ≤ 1) and may be omitted (in which case a default is used).
The slerp function may be regarded as a special case of the spherical mean: given two arbitrary quaternions, the following calls will return the same result, mid-way along the 'arc' between the two quaternions: slerp(p, q, 0.5) and spherical_mean([p,q])
The third parameter, t, gives the angular tolerance between the quaternions in q.
q is not restricted to be a real quaternion, but interpretation of the result in the biquaternion case is unknown, and a warning is currently generated.
spherical_mean([qi, qj, qk]) ans = 0.5774 * I + 0.5774 * J + 0.5774 * K