answersLogoWhite

0

float2 CartesianToSpherical(float x, float y, float z)

{

float2 SphericalPos;

SphericalPos.x = atan2(x,z)/6.28318f;

if(SphericalPos.x < 0.0f)

SphericalPos.x += 1.0f;

SphericalPos.y = atan2(sqrt(x*x+z*z),y)/3.14159f;

return SphericalPos;

}

User Avatar

Wiki User

17y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
JudyJudy
Simplicity is my specialty.
Chat with Judy
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan

Add your answer:

Earn +20 pts
Q: How do you change cartesian to spherical coordinates?
Write your answer...
Submit
Still have questions?
magnify glass
imp