<div dir="ltr"><div><div>Thank you, Dennis. Yes, I have used the gc_latlon function many times; it is very useful!<br><br>But, I am hoping to use a function that finds the distance between a point, and where it is closest to a line. If I can't, I'll just have to write my own function in FORTRAN instead to do that.<br><br></div>Hopefully someone else is familiar with the <b>gc_pnt2gc</b> function.<br><br></div>Joe<b><br></b></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 10, 2017 at 8:12 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Joe,<br></div><div><br></div>I have never used the '<b>gc_pnt2gc</b>' function. Hopefully, somebody will address that function.<br><br></div><div>There us an alternative:<br> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_latlon.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>gc_latlon.shtml</a><br><br></div>Try the following interactively<br><br></div>%> ncl <return><br></div><div>Then enter the following<br></div><div><div><span class=""><br>p_lat = 41.6<br>p_lon = -76.84<br>lat = (/52.9921,55.3543/)<br>lon = (/-168.693,-160.346/)<br></span>dist = gc_latlon(p_lat,p_lon,lat,lon,<wbr>10,2)<br></div><div>print(dist)<br></div><div><br>Variable: dist<br>Type: float<br>Total Size: 8 bytes<br> 2 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [2]<br>Coordinates: <br>Number Of Attributes: 4<br> units : degrees<br> gclon : <ARRAY of 20 elements><br> gclat : <ARRAY of 20 elements><br> spacing : ( 6.551194, 5.948726 )<br><br>(0) 58.96074<br>(1) 53.53853<br><br>===<br></div><div>Cheers<br></div><div>D<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Aug 9, 2017 at 1:21 PM, Joe Grim <span dir="ltr"><<a href="mailto:grim@ucar.edu" target="_blank">grim@ucar.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>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:<br><br> p_lat = 41.6<br> p_lon = -76.84<br> lat = (/52.9921,55.3543/)<br> lon = (/-168.693,-160.346/)<br> dist = gc_pnt2gc(p_lat,p_lon,lat,lon)<br> print ("The distance is: " + dist)<br><br></div>Here is the output:<br>(0) The distance is: 0.105952<br><br></div>I would expect the distance to be something around 53 degrees.<br><br></div>Could
someone please explain to me what I am misunderstanding about this
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.)<br><br></div>Thank you!<span class="m_-6134214703216481583HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-6134214703216481583HOEnZb"><font color="#888888">Joe Grim<br></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>