Seeking Cartesian to Hyperspherical Coordinates Conversion Examples in Higher Dimensions

42 Views Asked by At

I've recently coded a function that transforms Cartesian points into hyperspherical points. While I've verified its accuracy for 2D and 3D points, I'm finding it challenging to test for higher dimensions due to the lack of available examples.

Surprisingly, my search for online tools that handle such conversions in higher dimensions came up short. I've also explored MATLAB and Mathematica but couldn't find a built-in function that accomplishes this.

Could anyone provide examples of Cartesian to Hyperspherical coordinates conversion in dimensions greater than three or give me resources that might have this information? It would be helpful for validating the correctness of my function.

Thank you in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

In all cases, the first column is Cartesian and the second hyperspherical.

For 4D space:

[1 0 0 0] [1. 0. 0. 0.]
[1 1 0 0] [1.41421356 0.78539816 0.         0.        ]
[1 1 1 0] [1.73205081 0.95531662 0.78539816 0.        ]
[1 1 1 1] [2.         1.04719755 0.95531662 0.78539816]
[-1  1  1  1] [2.         2.0943951  0.95531662 0.78539816]
[-1 -1  1  1] [2.         2.0943951  2.18627604 0.78539816]
[-1 -1 -1  1] [2.         2.0943951  2.18627604 2.35619449]
[-1  0  0  1] [1.41421356 2.35619449 1.57079633 1.57079633]

For 5D:

[0 0 0 0 1] [1.         1.57079633 1.57079633 1.57079633 1.57079633]
[-1  0  0  0  1] [1.41421356 2.35619449 1.57079633 1.57079633 1.57079633]
[-1  1  0  0  0] [1.41421356 2.35619449 0.         0.         0.        ]
[1 1 0 0 1] [1.73205081 0.95531662 0.78539816 1.57079633 1.57079633]
[-1  1  1 -1  0] [2.         2.0943951  0.95531662 0.78539816 0.        ]