1

I have a data set with values that can be represented in multi-dimensional cartesian space. e.g.:

> data = matrix(1:20, ncol = 4)
     [,1] [,2] [,3] [,4]
[1,]    1    6   11   16
[2,]    2    7   12   17
[3,]    3    8   13   18
[4,]    4    9   14   19
[5,]    5   10   15   20

Each row is a data-point, and each column represents a dimension. I would like to study the direction of each data point relative to the origin, rather than their absolute distance to the origin. I would therefore like to convert the data-set into a 4-d polar coordinate space (aka hyperspherical coordinates).

If I only wanted to convert two dimensions, this could be achieved using one of the answers here. Is there a general solution that will allow conversion to n-dimensional polar space? The closest example I have found is the CoordinateTransformData function in the Wolfram language, which generates the symbolic algebra for conversion into n-dimensions.

D Greenwood
  • 415
  • 2
  • 11
  • Maybe you find something there [Generating multidimensional data](https://stackoverflow.com/q/5016806/10488504) – GKi Jul 16 '20 at 14:19
  • Thanks GKI, unfortunately nothing helpful on that thread, which deals only with Cartesian coordiantes. – D Greenwood Jul 17 '20 at 08:47
  • One answer is converting from polar to cartesian. You have to inverse these steps. – GKi Jul 20 '20 at 06:27

0 Answers0