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

chaps555's Avatar, Join Date: May 2010
Newbie Member
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
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
Why can't you think of any relational operators and conditional statements in C?
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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)