Wikipedia says:
In two dimensions, angular acceleration is a number with plus or minus sign indicating orientation, but not pointing in a direction. The sign is conventionally taken to be positive if the angular speed increases in the counter-clockwise direction or decreases in the clockwise direction, and the sign is taken negative if the angular speed increases in the clockwise direction or decreases in the counter-clockwise direction.
But how do I find out if the angular speed increases in clockwise or counter-clockwise direction?
For example, I have a torque of {<-0.49497476, 0.070710614>} and a moment arm of {<-0.5, -3.5>}. This should lead to a counter-clockwise spin. On the other hand, a torque of {<0.49497476, 0.070710614>} and a moment arm of {<0.5, -3.5>} should lead to a clockwise spin. What I'm missing is probably the right combination of signs here?
My code currently looks like this:
public void Accelerate()
{
float mass = Mass();
foreach (Thruster thruster in thrusters)
{
Vec momentArm = (Vec)MomentArm(thruster);
Vec force = MathUtil.Smooth(MathUtil.PolarToCartesian(thruster.CurrentForce, -thruster.OutputAngle));
Vec parallelForce = momentArm * (Vec.Dot(force, momentArm) / Vec.Dot(momentArm, momentArm));
Vec angularForce = force - parallelForce;
Vec torque = angularForce * momentArm.Length();
Velocity += parallelForce / mass;
RotationVelocity += torque.Length() / mass; // I always get a positive value here
}
foreach (Gyroscope gyroscope in gyroscopes)
{
RotationVelocity += gyroscope.CurrentAcceleration;
}
}