Hey guys/gals, I have a simple question.

I’m wondering if these two calculations are correct.

The first one, just says how many times per minute the object is rotating.
The second one, I tried to convert it to a vehicle version (1000x, 5000x, etc), but wold say 1, 5 instead of 1000.

Here are my two lines. I’m not sure if is precise, I need exact precision.

``````rpm = MyRigid.angularVelocity.magnitude * 60 / Mathf.PI;

rpm = MyRigid.angularVelocity.magnitude * RPMRatio * Mathf.PI * 2 * 60 / 1000;

RPMRatio = 0.166666666667f (Just so you know.)
``````

Yeah I know rpm is done twice (I just uncommented them), i’ll create a new variable for the second one if it is done correctly.

I’m just not exactly sure if I’m correct with the formula.

Thanks!

Both are actually not correct. The first one is almost right while the second makes not sense to me. What’s the point of the RPMRatio?

The angularVelocity is in “radians / s” so to get RPM you need to “normalize” the rotation amount by dividing by “2*PI” and to get minutes you need to multiply by 60. If you additionally want it kRPM you just need to divide again by 1000:

``````rpm = MyRigid.angularVelocity.magnitude * 60f / (Mathf.PI*2f);

krpm = MyRigid.angularVelocity.magnitude * 60f / (Mathf.PI*2f*1000f);
``````

When working with float literal values it’s better to always add the float sufffix “f”.

I’m just wondering what “MyRigid” actually represents. Is it a wheel? If it’s the vehicle itself, what kind of vehicle is it? Usually the vehicle itself doesn’t rotate at all.