Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   I want to map data which ranges between -1 to 1 to 0 to 1 (http://www.go4expert.com/forums/i-map-data-ranges-1-1-0-1-t22090/)

chaps555 13May2010 12:18

I want to map data which ranges between -1 to 1 to 0 to 1
 
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

venami 14May2010 09:15

Re: I want to map data which ranges between -1 to 1 to 0 to 1
 
Why can't you think of any relational operators and conditional statements in C? :)

xpi0t0s 14May2010 12:43

Re: I want to map data which ranges between -1 to 1 to 0 to 1
 
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)


All times are GMT +5.5. The time now is 05:51.