Mapping function from 2D to 1D

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 5K views
abhishek2301
Messages
4
Reaction score
0
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!
 
Mathematics news on Phys.org
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.