If by polar
you mean the magnitude of the vector, and elevation
is defined as the angle between vector and the xy plane (as the name implies), the function would be:
public Vector3 getCartesianFor(float elevation, float asimuth, float polar)
{
return new Vector3(polar*Cos(elevation)*Cos(asimuth),
polar*Cos(elevation)*Sin(asimuth),
polar*Sin(inclination));
}
Note that this is very similar to MLM's answer, it all depends on how you define your elevation
angle. I've also respected your function template signature, but I suggest a few changes:
asimuth
is a typo, the correct spelling would be azimuth
polar
usually refers to the 2D coordinate system (r, θ). The magnitude of the vector is commonly referred to as radius
- A more conventional order would have
radius
as the first parameter.