## Quaternion for 3D FPS Camera

I'm trying to look how the formula made on this site. I want to know how this formula was derived. I tried to look on Quaternions and Rotation Sequences book but they use sin/cos which is so different on this.

N.w = a.w*b.w - a.x*b.x - a.y*b.y - a.z*b.z
N.x = a.w*b.x + a.x*b.w + a.y*b.z - a.z*b.y
N.y = a.w*b.y - a.x*b.z + a.y*b.w + a.z*b.x
N.z = a.w*b.z + a.x*b.y - a.y*b.x + a.z*b.w

or maybe I'm lost?

 PhysOrg.com science news on PhysOrg.com >> Heat-related deaths in Manhattan projected to rise>> Dire outlook despite global warming 'pause': study>> Sea level influenced tropical climate during the last ice age
 Mentor The quaternions form a number system under which addition and multiplication are each closed and associative. Addition is commutative in the quaternions but multiplication is not. There are many ways to look at quaternions as a whole. One view is that a quaternion comprises four real numbers under which multiplication is defined as in the original post. Another view, Hamilton's view, is that a quaternion comprises a real part and three distinct imaginary parts. Yet another is that a quaternion comprise a scalar real part and a vectorial (three vector) imaginary part: $Q=(q_s, \mathbf q_v)$. Denoting two quaternions as $Q_1=(q_{1s}, \mathbf q_{1v}), Q_2 = (q_{2s}, \mathbf q_{2v})$ then the quaternion product $Q_1Q_2$ can be written using the vector dot and cross products as $$Q_1Q_2 = (q_{1s}q_{2s} - \mathbf q_{1v}\cdot\mathbf q_{2v},\;\; q_{1s}\mathbf q_{2v} + q_{2s}\mathbf q_{1v} + \mathbf q_{1v}\times\mathbf q_{2v})$$ The book Quaternions and Rotation Sequences primarily focuses on unit quaternions. While the unit quaternions are useful (very useful) for representing rotations and transformation, there is a lot more to the quaternions than just the unit quaternions.
 Read it many times but I still didn't understand some of the things you've said. I just don't get it how it is made. Anyway, do you know what's the pre-requisite for quaternion topics? Is it Linear Algebra? Because I don't understand most of the topics in the book Quaternions and Rotation Sequences. Maybe I jump ahead so fast.

Mentor

## Quaternion for 3D FPS Camera

 Quote by sarah2529 Because I don't understand most of the topics in the book Quaternions and Rotation Sequences. Maybe I jump ahead so fast.

Some more detailed questions:
Do you understand complex numbers?
Do you understand Euler's identity $\exp(i\theta) = \cos \theta + i\sin\theta$?
How much do you know about real and complex analysis?
How much do you know about linear algebra?

 Quote by D H Do you understand complex numbers?
I guess so.

 Quote by D H Do you understand Euler's identity $\exp(i\theta) = \cos \theta + i\sin\theta$?
Nope. What's that?

 Quote by D H How much do you know about real and complex analysis?
Yes, I'm taking Calculus 2 class right now.

 Quote by D H How much do you know about linear algebra?
So little. But I know how to use row reduced in matrices. Thanks to the opencourseware.

Basing on what you've asked, I really did jump so fast. So what would you recommend to me? I really want to understand those quaternions for my 3D First Person Camera Engine.

Mentor
Quote by sarah2529
 Quote by D H Do you understand Euler's identity $\exp(i\theta) = \cos \theta + i\sin\theta$?
Nope. What's that?
That response means you do not really understand complex numbers.

Quote by sarah2529
 Quote by D H How much do you know about real and complex analysis?
Yes, I'm taking Calculus 2 class right now.
Whoa, Sarah!

Here's a sequence in an undergrad math curriculum: Calculus I & II, Ordinary differential equations, Multivariable calculus, Introduction to analysis, Linear algebra, Real analysis, Complex analysis, Calculus of variations, Differential geometry, Abstract algebra (I, II, & III !!), General topology, Geometric topology, Algebraic topology, ...

You'll run across the quaternions in the second or third abstract algebra class. You'll find out why they are useful for representing rotations when you take algebraic topology. Trying to understand quaternions when you have not yet finished Calc 2 is jumping the gun. Without the requisite intermediate knowledge all you will have will be a bunch of formulae that just don't make much sense.

As a test, see how much sense you can make of this Wikipedia article: http://en.wikipedia.org/wiki/Charts_on_SO(3)