Re: [idvusers] Lambert Conic Projection query

Hi Stuart-

Stuart Maclean wrote:
I am not sure of the correct home for the ucar.unidata.geoloc.*
package, is it IDV, Netcdf, or some other jar?

The IDV and netCDF Java share some common code and now that
package is part of the netCDF-Java source.

Anyway, in idv 2.2 there exists
ucar.unidata.geoloc.projection.LambertConformal.  I am
copying/transcribing this class into a GWT (Java -> Javascript)
class.  I note this snippet in the projToLatLon method:

double yd = (rhop - fromY); double theta = Math.atan2(fromX, yd); double r = Math.sqrt(fromX * fromX + yd * yd); if (n < 0.0) {

In the call to Math.atan2, we clearly have some x distance as first
parameter, with y second.

Yet the api for java.lang.Math.atan2 suggests that the parameter
order is y, x.  Can anyone explain why the apparent mismatch? I have
used this class in apps before and it seems to work fine.


for an explanation of the algorithm.  In particular, this
is from:

theta   =       tan^(-1)(x/(rho_0-y))

which ends up as atan(x,y)

Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307