I have 2 points $A=(x_A,y_A), B=(x_B,y_B)$ on a unit circle $O$. The distance between $A$ and $B$ goes through the perimeter of the circle. How can I transform this space to a space with higher dimensions where the distances can be computed using Euclidean formula, and the original distances are preserved as much as possible? In fact, I don't know what is the main field of math concerning such transformations.
Your help is appreciated.
Hint:
Map the points using the transform
$$\tan(z)=\frac yx,$$ where $z$ is evaluated on four quadrants, and the distance between $A$ and $B$ turns to the Euclidean $$|z_A-z_B|.$$
Unfortunately, an essential nonlinearity remains because of phase wraparound, and the exact formula must be
$$\pi-||z_A-z_B|-\pi|.$$