/ Published in: Objective C
Expand |
Embed | Plain Text
/* float m = map(value, 0, 100, 0, width); Re-maps a number from one range to another. In the example above, the number '25' is converted from a value in the range 0..100 into a value that ranges from the left edge (0) to the right edge (width) of the screen. */ -(float)map:(float)value currLow:(float)currLow currHigh:(float)currHigh tarLow:(float)tarLow tarHigh:(float)tarHigh{ return tarLow + (tarHigh - tarLow) * ((value - currLow) / (currHigh - currLow)); }
You need to login to post a comment.
