Jump to content
  • Advertisement
Sign in to follow this  
egwenejs

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!