Find number between secuence

34 Views Asked by At

I'm needing some help with the following problem, lets say i have a reference table for the fuel tank levels of a vehicle in Volts, being 0 for empty tank and 8 for a full tank, i divided in 8 pieces to have more precision.

Now lets say i receive information that the vehicle has 0.283v meaning this will locate the needle somewhere between 7 and 8, can you guys help me out with a formula to calculate this value for the needle (7.something)

8 -> 0.256v
7 -> 0.295v
6 -> 0.334v
5 -> 0.373v
4 -> 0.412v
3 -> 0.485v
2 -> 0.56v
1 -> 0.608v
0 -> 0.641v

This is what i currently have,

Voltage = 0.283v

0.295 - 0.256 = 0.039
0.295 - 0.283 = 0.012

Rule of 3

( 100 * 0.012 ) / 0.039 = 30.76

This will put the needle in $7.30$, is this ok? Thanks