let fraction:CGFloat = 1.0 // This is fraction
let minValue:CGFloat = 60.0 // This is minimum value where slider starts
let maxValue:CGFloat = 240.0 // This is maximum value where slider end
let formula = (((maxValue)-(minValue)) * fraction) + minValue //min value is 60 here
// Above formula translate to = (((240.0)-(60.0)) * 1.0) + 60
//to get an answer between 60 to 240 I'm adding "+60" to the calculated answer and subtracting minValue from max value
//EVERYTHING IS PERFECT TILL HERE
Now I'm confused on how do get reverse the fraction if the value is 74.0
let initialSliderValue:CGFloat = 74.0
let fractionOf74 = (initialSliderValue/maxValue) // 74.0/240.0 = 0.3083333333
let ans = (maxValue * fractionOf74) + 60
// How do i get extact fraction to get answer of 74
//PLEASE NOTE I NEED TO ADD +60 to my answer so i get answer between 60 to 250
Thanks for help in advance
I don't know what language this is, but I believe you can fix this using
Then
The key is that you just consider the fraction of the interval
[minValue, maxValue], but what you did was considering the fraction of the interval[0, maxValue].