Mapping function from 2D to 1D

Click For Summary
SUMMARY

The discussion focuses on creating a mapping function to convert 2D coordinates within the range of [-4, +4] into a 1D real-valued number between 0 and 1.0, with specific value assignments based on quadrants: the 1st quadrant receives values from 0.4 to 1, the 2nd and 3rd quadrants receive values from 0.2 to 0.4, and the 4th quadrant receives values from 0 to 0.1. The proposed formula for determining the direction from the origin is cos(atan(y/x) - π/4), which maps the values into the interval of -1 to 1. Further adjustments are necessary to fit this range into the desired target range.

PREREQUISITES
  • Understanding of trigonometric functions, specifically cosine and arctangent.
  • Familiarity with coordinate systems and quadrants in a 2D space.
  • Basic knowledge of mathematical mapping and range transformations.
  • Experience with programming concepts for implementing mathematical functions.
NEXT STEPS
  • Research how to implement the mapping function in Python using NumPy.
  • Explore range transformation techniques to convert values from one interval to another.
  • Learn about the implications of using trigonometric functions in mapping applications.
  • Investigate other methods for 2D to 1D mappings, such as Hilbert curves or space-filling curves.
USEFUL FOR

Mathematicians, data scientists, and software developers interested in spatial data representation and transformation techniques.

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.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 55 ·
2
Replies
55
Views
5K
  • · Replies 13 ·
Replies
13
Views
5K