How do I calculate Angular Velocity pass into SetPhysicsAngularVelocity?

I have a component that I am going to detach and enable physics on. How do I calculate angular velocity so that its motion is smooth and visually consistent? Is this in degrees or radians? What coordinate space is this? World or local? Can someone show me a snippet?

Months of trial and error and I still haven’t been able to figure it out. Is one of the axes flipped?

FQuat Orientation = GetComponentQuat();
FQuat DeltaQ = OldOrientation.Inverse() * Orientation;
FVector Axis;
float Angle;
DeltaQ.ToAxisAndAngle(Axis, Angle);
Angle = FMath::RadiansToDegrees(Angle);
AngularVelocity = Orientation.RotateVector((Axis * Angle) / DeltaTime);
OldOrientation = Orientation;

This took way longer than it should have to trial and error out.

mh is it possible to do with a rotator instead?

actually thos doesn’t work. let’s say the component turns right, it is possible that this function gives an angular speed for the opposite direction(like going the long way around)

Really? I’ve never noticed this behavior. Can you elaborate on why this is the case?