Hello,
I am trying to figure out hope to pass some Spherical coordinates and get
Cartesian coordinates bask.
I have found some examples online, but I am not able to make them work for me
yet.
here is what I have put together:
public function convert(pRadious:Number=1, pTheata:Number=0, pPhi:Number=0
):Point3D {
var r = pRadious;
var phi = pPhi;
var theta = pTheata;
// convert
var pX = r * Math.sin(theta) * Math.cos(phi);
var pY = r * Math.sin(theta) * Math.sin(phi);
var pZ = r * Math.cos(theta);
return new Point3D(pX, pY, pZ);
} // method
I was hoping that someone can lend some help.
Best Qutaibah