Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mapping function from 2D to 1D

  1. May 21, 2012 #1
    I have 2D elements distributed in a space of [-4, +4] and want to convert any point in the 2D space to a 1D real-valued number 0~1.0 such that 1st quadrant [+, +] should have higher values (importance) suppose 0.4~1 , 2nd and 3rd quadrant [+, -] and [-, +] should be next 0.2~0.4, and the 4th quadrant [-, -] should have the least values 0~0.1.

    How can I have such a mapping function!

    Thanks!
     
  2. jcsd
  3. May 22, 2012 #2

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    The direction of the point from the origin carries the information you want, so the first thing is to find a formula for that. Maybe
    cos(atan(y/x)-pi/4)
    That maps all the values into the interval -1, 1, with the quadrant boundaries at √2/2 and -√2/2. It's symmetric about y=x, as desired. It remains to map that 1D range into the desired target range.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mapping function from 2D to 1D
Loading...