[Papervision3D] Conversion between Spherical and Cartesian Coordinates Systems

brawlis brawlis at live.com
Thu Jun 4 00:21:20 PDT 2009


Hello

I have problems with conversion from certisan to spherical coordinate
systems.

I used formula from wikipedia
http://en.wikipedia.org/wiki/Spherical_coordinates
but nothing, then I tried:
public function InverseCordinates(x:Number,y:Number,z:Number):Number2D{
	var cordinates:Number2D = new Number2D(0,0);
	cordinates.x = Math.atan2(x,z)/(2*Math.PI);
	if(cordinates.x < 0){
		cordinates.x += 1;
	}
	cordinates.y = Math.atan2(Math.sqrt(x*x+z*z),y)/Math.PI;

	return cordinates;
}

But nothing :( :(
-- 
View this message in context: http://www.nabble.com/Conversion-between-Spherical-and-Cartesian-Coordinates-Systems-tp23811651p23811651.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list