Calculating Gear Using Rev/Speed Ratio

This can be a nice math exercise :slight_smile:

Ratio of each gear is:

Tire RPM / Engine RPM.

To calculate Tire RPM, you first need the tire circumference. Lets say that you have 245/40x18 tire.

Circumference of the tire in meters is calculated as:
(tireWidth * tireAspect / 100 + wheelDiameter * 25.4 * 0.5) * 2 * PI / 1000;

So 245/40x18 tire circumference would be:
(245 * 40 / 100 + 18 * 25.4 * 0.5) * 2 * PI / 1000 = 2.05 meters

Now we have the circumference, we can calculate the tire RPM based on circumference and speed.

Speed in meters per minute is:
V (in km/h) * 1000 (meters in a km) / 60 (minutes in an hour)

So Tire RPM is:
TireRPM = CurrentSpeedKPH * 1000 / (60 * TireCircumference);

The current gear ratio is then simply Engine RPM / TireRPM