calculating the angular velocity

Hello,

What is the method to calculate the direction of rotation of a vector ? I'm trying to calculate the angular velocity from starting from a linear velocity, but the result is always positive. Here's my code (my source is here) :

Code:
// the center of the body2 is the origin

var distance:b2Vec2 = new b2Vec2( body1.GetPosition( ).x, body1.GetPosition( ).y );
distance.Subtract( body2.GetPosition( ) );

var velocity:b2Vec2 = new b2Vec2(body1.GetLinearVelocity( ).x, body1.GetLinearVelocity( ).y);
velocity.Normalize( );

var angle:Number = velocity.AngleTo( distance );
var angleVel:Number = Math.sin( angle ) * velocity.Length( ) / 1; // radius = 1
body2.SetAngularVelocity( angleVel );


I want to apply an identical angular velocity to the object2 regardless of the distance of the point where the force is applied.
you have to set angular velocity AND torque... i'm pretty sure the angular velocity is auto calculated in the body
I understand, but if I do this, the torque cancel the angular damping applied on the body.
Finally, I'm using this method to rotate my body 🙂

Code:
var distance:b2Vec2 = new b2Vec2( body1.GetPosition( ).x, body1.GetPosition( ).y );
distance.Subtract( body2.GetPosition( ) );
            
var velocity:b2Vec2 = new b2Vec2(body1.GetLinearVelocity( ).x, body1.GetLinearVelocity( ).y);
velocity.Normalize( );
velocity.Multiply( rotationForce * distance.Length( ) );

body1.SetAwake( false );
body2.ApplyImpulse( velocity, body1.GetPosition( ) );
ok just be sure of "body1.SetAwake( false );"

Original thread: https://box2d.org/forum/viewtopic.php?t=4857