Math algorithm/function to convert this number to 40?
I’m programming a knob that has an arrow that’s position is defined from an arc number.
I’m looking to find a way to convert this arc number to a number that will represent a temperate.
The minimum this number will be is 1.3 and the maximum this number will be is 1.7
1.3 needs to equal 40 and 1.7 needs to equal 99
Is this possible?
Observing members:
0
Composing members:
0
6 Answers
Sure the equation is y = 147.5x – 151.75
Where x is the number that goes from 1.3 to 1.7
And Y is the one that goes from 40 to 90.
If you want it the other way let me know.
Here it is:
y = 0.0068x + 1.0288
Enjoy
How would the function change if the minimum number is -1.3?
I forgot to add the -
Sorry.
No problem. I did it in excel
y = 19.667x + 65.567
or
y = 0.0508x – 3.3339
You mind sharing how you did this in Excel? It would be useful should he ever need to make another range conversion—plus I’m intrigued.
Sure. First, I started to solve the equations mathematically like we learned in 8th grade.
Then I got lazy and decided to check it by making a short table of the four numbers.
x y
-1.3 40
1.7 99
And hit “Insert” “Scatter plot” Then selected “Add Trend line” “Linear” “Show equation”.
I then swapped the two columns and did it again. It took less than 4 minutes.
Just learned a new Excel trick, thanks!
Answer this question ![sending...](//d3phpakcjc7x1x.cloudfront.net/images/v2/ajax-loader.gif)
This question is in the General Section. Responses must be helpful and on-topic.