I understand how to scale and offset values such as 0 - 3000 you can take to * 0.09 + 0.01. But is it possible to have values going from 15 - 8 and use same basic math to scale that to 0 - 1?
Many thanks
Joel
I understand how to scale and offset values such as 0 - 3000 you can take to * 0.09 + 0.01. But is it possible to have values going from 15 - 8 and use same basic math to scale that to 0 - 1?
Many thanks
Joel
It's something like:
to scale x in the range A to B => range C to D
Maybe this
( x - A ) / (B - A) * (D - C) + C
It's just algebra, you should be able to check.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.