I think you may have misread what happens when x is 0 and y is not 0. When X is 0 and Y is positive atan2 returns PI/2. When X is 0 and Y is negative atan2 returns -PI/2.
The only "if" needed is when both X and Y are 0. -----Original Message----- From: Schmidt, Richard, SDGE1 [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 06, 2006 4:35 AM To: [email protected] Subject: [osg-users] EllipsoidModel::convertXYZToLatLongHeight Hi, I was looking at the method mentioned above, which is used for calculating the lat/long from a geocentric position. The longitude gets calculated using longitude = atan2(Y,X); However when X = Y = 0 the MSDN says: atan2 is well-defined for every point other than the origin, even if x equals 0 and y does not equal 0. I guess we need an "if" here. :-) Richard _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
