# How to get angular momentum from two quaternions? - Java-Games

This is a discussion on How to get angular momentum from two quaternions? - Java-Games ; I have a physics engine that I'm using in a simulation. As part of a Verlet intergration step, I need to be able to calculate the angular momentum for a rigid body, based on the start and end orientation of ...

1. ## How to get angular momentum from two quaternions?

I have a physics engine that I'm using in a simulation. As part of a
Verlet intergration step, I need to be able to calculate the angular
momentum for a rigid body, based on the start and end orientation of
the body.

This is what I know:

q1 = start orientation of the body as a quaternion (which I can of
course convert to a rotation matrix)
q2 = end orientation of the body as a quaternion
t = time elapsed between start and end orientation
m = mass of the body
I = inertia tensor of the body

We can assume that angular velocity is constant during the
rotation.

How can I compute angular momentum of the body using the
information listed above?

2. ## Re: How to get angular momentum from two quaternions?

mayoneez wrote:

> I have a physics engine that I'm using in a simulation. As part of a
> Verlet intergration step, I need to be able to calculate the angular
> momentum for a rigid body, based on the start and end orientation of
> the body.
>
> This is what I know:
>
> q1 = start orientation of the body as a quaternion (which I can of
> course convert to a rotation matrix)
> q2 = end orientation of the body as a quaternion
> t = time elapsed between start and end orientation
> m = mass of the body
> I = inertia tensor of the body
>
> We can assume that angular velocity is constant during the
> rotation.
>
> How can I compute angular momentum of the body using the
> information listed above?

Angular momentum is L = I omega, where omega is the angular velocity of
the object and I is the moment of inertia (what I assume you mean by
inertia tensor above). That means

L = I dtheta/dt,

where theta is the angular displacement and t is time. So that's
approximately equal to

L = I delta theta/t

= I (theta_2 - theta_1)/t.

Where theta_1 is the initial angular displacement and theta_2 is the
final. So convert your starting and ending quaternions to angular
displacement vectors, divide by the elapsed time, and concatenate that
with your moment of inertia tensor. Convert between local and world
coordinates as necessary (you don't say which is in what coordinates above).

--
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
Would a harvest from my heart / Find its season
-- Sandra St. Victor

3. ## Re: How to get angular momentum from two quaternions?

Thanks. I'll give it a try.