# Mapping points on the unit circle

I have a set of points P that are evenly spaced on a square grid of length 1...

I would like to map these points to the circle of radius 1 as nicely as possible, while preserving relative positions as much as possible. That is, the points in the square grid should map to the points in the unit circle.

How can this be done in Mathematica?

-
Assuming that a map is a function, by what criterion should the mapping be done? Closest (highlighted) point on the unit circle? –  David Carraher Aug 30 '14 at 8:13
Do the circle and square have the same center? (e.g. {0,0})? –  David Carraher Aug 30 '14 at 8:20
Do you mean Circle or Disk? –  shrx Aug 30 '14 at 8:48

Your question is a little vague but one possible mapping from a square to a circle is the following.

This transformation wrapped into a Mathematica function:

transformation[points_] := {#[[1]] Sqrt[1 - (#[[2]]^2/2)],
#[[2]] Sqrt[1 - (#[[1]]^2/2)]} & /@ # & /@ points;


And a little demonstration:

points = Table[{a, b}, {a, -1, 1, 0.2}, {b, -1, 1, 0.2}];

Show[
Graphics[{EdgeForm[Thick], White, Rectangle[{-1, -1}, {1, 1}]}],
ListPlot[Flatten[points, 1], AspectRatio -> 1, PlotStyle -> Red]
]
Show[
Graphics[{Thick, Circle[]}],
ListPlot[Flatten[transformation[points], 1], AspectRatio -> 1, PlotStyle -> Red]
]


-
Nice answer, but no need for Show and ListPlot. Suggest Graphics[{EdgeForm[Thick], FaceForm[None], Rectangle[{-1, -1}, {1, 1}], Red, PointSize[Medium], Point[Flatten[points, 1]]}] and Graphics[{Thick, Circle[], Red, PointSize[Medium], Point[Flatten[transformation@points, 1]]}] –  m_goldberg Aug 30 '14 at 5:35