# How to get a position from a radial distance and angles?

I have a radius and the 2 angles for northSouth and eastWest rotations in degrees. I need a Spherical position or a cartesian position (I have code translate one to the other)

Where a position is defined as one of the following ...

class Vector {
public float x; // distance along x axis
public float y; // distance along y axis
public float z; // distance along z axis
}

class SphericalPosition {
public float radius;       // distance from center
public float azimuth;      // distance from 0 degrees around polar axis
public float inclination;  // distance up from equator (x,z plane)
}


I am looking for an implementation to one of the following 2 methods ...

SphericalPosition FromAngles(float radius, float degreesUpDown, float degreesRound)
{

}

Vector FromAngles(float radius, float degreesUpDown, float degreesRound)
{

}


EDIT: Maybe someone can confirm or deny this but given a radius and 2 angles I believe this is referred to as a polar coordinate?

So in that light I guess i'm asking how to convert from a polar coordinate defined as the following ....

class PolarPos
{
public float radius;         // distance from center
public float AngleUpDown;    // rotation of x,z plane
public float AngleLeftRight; // rotation round y axis
}


... in to one of the above

EDIT 2: Ah ha ok it looks like what I have are the radius and ...

orbital / inclination angle (in degrees): http://en.wikipedia.org/wiki/Orbital_inclination

and the polar / azimuth angle (in degrees): http://en.wikipedia.org/wiki/Azimuth

And essentially I think I need the math to turn degrees in to longitude / latitude type coords (the spherical position as defined above).

• Are you asking how you convert Geographic coordinates to Cartesian coordinates? – Casey Mar 1 '15 at 15:28
• not exactly ... i have the radius and an angle on 2 axis and I want either a cartesian or a spherical position, if I had one I could convert to the other but I have neither. – War Mar 1 '15 at 15:53
• How is this question not trivially addressed by Googling "Azimuthal Coordinates", yielding: en.wikipedia.org/wiki/… – Pieter Geerkens Mar 1 '15 at 16:04
• Maybe its my understanding of these coordinate systems that is wrong ? is a spherical positions azimuth and inclination values distances or angles? I think they are distances and its the angles I have. – War Mar 1 '15 at 16:09
• Regardless whether you are needing polar or spherical coordinates, you need 2 angles and one distance (for 3D, at least. 2D only requires one angle) – Casey Mar 1 '15 at 16:12

I was having this issue today and thought I would share what I found. Link to some Maths!

I resolved this code into the following C# code, making note that my up axis is Y:

private Vector3 getPosition(float hAngle, float vAngle, float distance)
{
Vector3 result = new Vector3();