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;
}
Chat with our AI personalities
The cartesian coordinates are plotted on the cartesian plane
You do not have 3 coordinates in the Cartesian plane. The Cartesian plane is a plane and is therefore 2 dimensional. In 2 dimensional space you require only 2 coordinates. 3 coordinates are required to locate a point in 3-dimensional space but then it cannot be a Cartesian PLANE.
The x coordinates are horizontal whereas the y coordinates are vertical on the Cartesian plane.
René Descartes is usually given credit. Hence the name "Cartesian coordinates".
Cartesian coordinates are plotted on the Cartesian plane which consist of a horizontal x axis number line and a vertical y axis number line whereas both axes are perpendicular to each other and meet at right angles at the point of origin whose coordinates are at (0, 0)