# Why is Unity using a Quaternion for rotation, but a Vector3 for angular velocity?

Unity uses quaternions for storing the rotation of rigid bodies, but vectors for the angular velocity. Why? I thought you'd use a quaternion instead of that vector also. I don't know much about quaternions and stuff, so please excuse me if this is a dumb question.

• Is there something you think you'd want to do with an angular velocity that you cannot do with a Vector3? I'm struggling to think of any applications of angular velocity that would demand that it be in quaternion format... Nov 23 at 18:39
• @DMGregory the only reason I am aware of for using quaternions is to avoid the gimbal lock of rotational matrices. An explanation why that concern doesn't apply here would be cool to read. Nov 29 at 23:41
• How would an angular velocity vector experience gimbal lock? It's not clear to me what that question would even mean in this context to be able to answer it. Nov 29 at 23:43

## 1 Answer

Because not only is a Vector3 more compact, a quaternion can only represent a rotation of up to +/- 1 turn signed.

If you're storing angular velocity as "rotations per second" your object could be spinning at more than 1 rotation per second, a quaternion doesn't work for this (even if you chose a smaller time base you will reach a similar problem)

A Vector3 angular velocity can be longer than 1 unit of length to represent faster rotations than a quaternion could.

It's also much easier to work with when calculating friction, combining/adding angular velocity, multiplying by the frame delta time, clamping rotation speed (a simple vector length check), etc