NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

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.

See:

http://mathworld.wolfram.com/LambertConformalConicProjection.html

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
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************




  • 2007 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the idvusers archives: