# Hypersherical Coordinates

This topic is 4957 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi I'm working on a 4D problem and I'm can't figure out the conversion from cartesian to hyperspherical. Any and all help would be apprieciated.

##### Share on other sites
There must be many different favours of them(with different ordering of things).

Most logical one:
convert x,y,z part to spherical coordinates a,b then find
c=atan2(w,sqrt(x*x+y*y+z*z));
and compute r=sqrt(x*x+y*y+z*z+w*w)
so you have hyperspherical coordinates
a,b,c,r

That is,
a=atan2(y,x)
b=atan2(z,sqrt(x*x+y*y));
c=atan2(w,sqrt(x*x+y*y+z*z));
// and so on for higher dimensions
// now, compute r
r=sqrt(x*x+y*y+z*z+w*w);

where atan2(y,x) = +/- atan(y/x) . atan2 just gives correct signs of angle for x and y in all quadrants. (example: atan(-1 / -1)=atan(1)=pi/4=45 degrees. And atan2(-1,-1)= pi*5/4 = 225 degrees)

Back conversion from hyperspherical to spherical:
x=cos(a);
y=sin(a);
z=sin(b); x*=cos(b); y*=cos(b);
w=sin(c); x*=cos(c); y*=cos(c); z*=cos(c);
// and so-on for higher dimensions.

//finally scale by r:
x*=r; y*=r; z*=r; w*=r;

Note: i wrote it using "*=" to clarify idea of extending to higher dimensions.

BTW, why you need them? Doesn't look like thing that is "more intuitive" (simpler to work with) than 4D Cartesian.

##### Share on other sites
Awesome thanks. I'm working on making a model of the solutions to the Schrodinger equation with coloumb potentials. The equations are more naturally solvable in spherical than cartesian coords. Now to compute the laplacian. Wish me luck.

1. 1
Rutin
70
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633422
• Total Posts
3011804
• ### Who's Online (See full list)

There are no registered users currently online

×