# [ncl-talk] understanding function gc_pnt2gc

Joe Grim grim at ucar.edu
Wed Aug 9 13:21:35 MDT 2017

```Hi,

I have used the function gc_pnt2gc, but it doesn't appear to be doing what
I think it should be doing.  I assume this is because I am misunderstanding
it.  What I think it does is give the distance in degrees between a lat/lon
point (p_lat, p_lon), and its closest approach to the great circle line
between two other lat/lon pairs (lat[2], lon[2]: and I assume that this
great circle line is the shortest greatest circle line between these
lat/lon pairs.)  Here is an example snippet of what I am trying to do:

p_lat = 41.6
p_lon = -76.84
lat = (/52.9921,55.3543/)
lon = (/-168.693,-160.346/)
dist = gc_pnt2gc(p_lat,p_lon,lat,lon)
print ("The distance is: " + dist)

Here is the output:
(0)     The distance is: 0.105952

I would expect the distance to be something around 53 degrees.

function?  And, do you know of another function that does what I am trying
to do?  (That is, find the shortest distance between a point and a line on
the Earth.)

Thank you!

Joe Grim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170809/4ddafe50/attachment.html
```