I want to map data which ranges between -1 to 1 to 0 to 1

Newbie Member
13May2010,12:18   #1
chaps555's Avatar
Hello friends,

Can anyone give me any clue how can i map data which ranges from -1 to 1 to 0 to 1.

using C language.

Regards

chaps
Ambitious contributor
14May2010,09:15   #2
venami's Avatar
Why can't you think of any relational operators and conditional statements in C?
Mentor
14May2010,12:43   #3
xpi0t0s's Avatar
Same way you would do it in any other language. What would you do to -1 to get 0, to 1 to get 1, and 0 to get 0.5? (Hint: Translate and Scale)