Scaling Factors

R

Thread Starter

Richard

My math is very rusty and I have to convert a Value to Degrees.F
Can anyone help with the Factor and Offset?

Value = 11936
F = ((Value * 0.03125) - 273) * 1.8 + 32

Here it is worked out.
Value = 11936
11936 * 0.03125 = 373 - 273 = 100 degrees C
100 Deg.C * 1.8 + 32 = 212 Deg. F

So what I need is the "Factor" and the "Offset"

11936 * Factor + Offset = 212 Deg.F

What is the Factor, What is the Offset?
 
This is all about moving the mathmatical operations. There are some algebraic laws that are need to answer the question, primarily the distributive law is x(y+z)= x*y + y*z. This can be carried out as many times as need to come up with the solution.

F = (Value*0.03125*1.8)-(273*1.8)+32
F = (Value*0.05625) - 491.4 + 32
F = Value*(0.05625) + (-459.4)

So from this you have a factor that multiples to the original value, and an offset that adds to the value.
 
case C2FAHRENHEIT:
ret = (val * 9.0f / 5.0f) + 32.0f;
break;
case FAHRENHEIT2C:
ret = (val - 32.0f) * 5.0f / 9.0f;
break;
 
Top