# Integrating angular velocity

This topic is 4470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I would get current angle using angular accelation. To calculate current angle, I have to integrate angular accelation and velocity. In translation, I can get current velocity and position calculating "previous_velocity + dt * cur_accelation" and "previous_position + dt * current_velocity". But in rotation over arbitary axis, if I present the angular velocity and accelation as either quaternion or rotation matrix, can I get it calculating "previous_anglar_velocity * dt * current_angular_accelation" and "previous_angle * dt * current_angular_velocity" ? Thank you.

##### Share on other sites
It's not a good idea to use quaternions for angular velocity, but to answer your question, q' = q0*qvdt. Matrices might work the same way, but I don't know if Mdt is valid for non-integer values of dt.

##### Share on other sites
Can I know which repesentation is better for angular velocity?
I calculated angular accelation from torque, first.
That is, I got rotation axis for accelation quaternion from the direction of torque vector and the magnitude of the angle for accelation quaternion from the magnitude of torque vector.
This seems not to be general idea.
Are there better ideas?

##### Share on other sites
Quote:
 That is, I got rotation axis for accelation quaternion from the direction of torque vector and the magnitude of the angle for accelation quaternion from the magnitude of torque vector.This seems not to be general idea.Are there better ideas?
I'm not sure if I followed that, but yeah, I don't think that's how it's usually done.

Generally, torque is a vector, and is the derivative of momentum, which is also of course a vector. Angular velocity (also a vector) is derived from angular momentum via the inertia tensor. The next step is to integrate orientation from angular velocity. Orientation is usually represented by either a 3x3 matrix or a quaternion. Here it should be obvious that angular velocity can't be the derivative of orientation, since the types are different (vector vs. matrix or quaternion). However, you can derive the derivative (an intermediate value) from the angular velocity vector for both matrices and quaternions. For example, the derivative of the 3x3 orientation matrix is the product of a skew-symmetric matrix built from the angular velocity, and the current orientation matrix. This effectively finds the instantaneous velocity of each of the three basis vectors as the cross product of the current basis vector and the angular velocity. The orientation matrix is then orthogonalized after the update to correct error.

I can't guarantee I got all that right, so make sure to check it against some other references...