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

Discussion in 'C' started by chaps555, May 13, 2010.

  1. chaps555

    chaps555 New Member

    Joined:
    May 13, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. venami

    venami New Member

    Joined:
    Dec 26, 2008
    Messages:
    195
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    Software Professional
    Location:
    India, Tamil Nadu, Cuddalore
    Home Page:
    http://mvenkatapathy.wordpress.com
    Why can't you think of any relational operators and conditional statements in C? :)
     
  3. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice