Processing math: 100%

Sunday, October 6, 2013

Geometric meaning of quaternion addition

I was reading some posts on StackOverflow about representing a rotation from one vector to another (
... calculate the quaternion which results, in twice the required rotation (as detailed in the other solution), and find the quaternion half-way between that and zero degrees. ... Calculating the half-way quaternion is simply a matter of summing the quaternions and normalizing the result, just like with vectors.
OK, I didn't remember anything about the geometrical interpretation of quaternion addition in my favourite references Real-time rendering or Physically Based Rendering: From Theory To Implementation .

Reached to the pencil ..

We have two unit quaternions, representing different rotations around the same axis:

Q=<asinθ2,cosθ2>P=<asinϕ2,cosϕ2>

The sum of the quaternions is

P+Q=<a(sinθ2+sinϕ2),cosθ2+cosϕ2>

Let's normalize this quaternion, using the trigonometry identities

u=θ2v=ϕ2sinu+sinv=2sinu+v2cosuv2cosu+cosv=2cosu+v2cosuv2

For the norm of the quaternion we have

|P+Q|2=|a|24sin2u+v2cos2uv2+4cos2u+v2cos2uv2==4|a|2cos2uv2(sin2u+v2+cos2u+v2)==4cos2uv2|P+Q|=2cosuv2

Dividing each quaternion component by the norm, gives us

<a2sinu+v2cosuv22cosuv2,2cosu+v2cosuv22cosuv2>==<asinu+v2,cosu+v2>==<asinθ+ϕ4,cosθ+ϕ4>

 which is exactly the quaternion for the rotation around axis a by angle  θ+ϕ2 - the angle halfway between θ and ϕ.

No comments: