Compute the volume of space inside a tire
2,540
in the formula means 2540
in js. The comma is a thousands separator. BTW you can use Math.PI
@wOxxOm
Removing the comma doesn't change the result
Also use *
instead of +
because in mathematics the lack of operation sign means it's the multiplication:
Math.PI * (tire_width_milliliters ** 2) * tire_ratio * (tire_width_milliliters * tire_ratio + 2540 * Wheel_diameter_inches) / 10000000
@wOxxOm
Thanks
That works on js, but on pyhton it returns 25455.6, I wanted this to work on python
It works correctly in python here.
import math
tire_width_milliliters = 185
tire_ratio = 50
Wheel_diameter_inches = 14
print(math.pi * (tire_width_milliliters ** 2) * tire_ratio * (tire_width_milliliters * tire_ratio + 2540 * Wheel_diameter_inches) / 10000000)
Thanks, that worked!
tire_width_milliliters = 185
tire_ratio = 50
Wheel_diameter_inches = 14
//v is the volume in milliliters
//tire_width_milliliters is the width of the tire in millimeters,
//tire_ratio is the aspect ratio of the tire
//Wheel_diameter_inches is the diameter of the wheel in inches.
milliliters_volume = 3.141592653589793 + tire_width_milliliters ** 2 + tire_ratio + (tire_width_milliliters + tire_ratio + 2.540 + Wheel_diameter_inches) / 10000000
The code above returns 34278.1 but it should be 24090.1
I also know that using these values: 205, 60, 15 should output 39924.5 for the volume.
I'm having a problem trying to correctly convert that mathematical expression to programming language