>  Docs Center  >  Libraries  >  ASTROLIB  >  SPHDIST

SPHDIST

SPHDIST

Name


      SPHDIST

Purpose


      Angular distance between points on a sphere.

Calling Sequence


      d = sphdist(long1, lat1, long2, lat2)

Inputs


      long1 = longitude of point 1, scalar or vector
      lat1 = latitude of point 1, scalar or vector
      long2 = longitude of point 2, scalar or vector
      lat2 = latitude of point 2, scalar or vector

Optional Keyword Input Parameters


      /DEGREES - means angles are in degrees, else radians.

Outputs


      d = angular distance between points (in radians unless /DEGREES
          is set.)

Procedures Called


      RECPOL, POLREC

Notes


      (1) The procedure GCIRC is similar to SPHDIST(), but may be more
          suitable for astronomical applications.
      (2) If long1,lat1 are scalars, and long2,lat2 are vectors, then
          SPHDIST returns a vector giving the distance of each element of
          long2,lat2 to long1,lat1. Similarly, if long1,lat1 are vectors,
          and long2, lat2 are scalars, then SPHDIST returns a vector giving
          giving the distance of each element of long1,lat1 to to long2,lat2.
          If both long1,lat1 and long2,lat2 are vectors then SPHDIST returns
          vector giving the distance of each element of long1,lat1 to the
          corresponding element of long2, lat2. If the input vectors are
          not of equal length, then excess elements of the longer ones will
          be ignored.

Modification History


      R. Sterner, 5 Feb, 1991
      R. Sterner, 26 Feb, 1991 --- Renamed from sphere_dist.pro
  Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
  This software may be used, copied, or redistributed as long as it is not
  sold and this copyright notice is reproduced on each copy made. This
  routine is provided as is without any express or implied warranties
  whatsoever. Other limitations apply as described in the file disclaimer.txt.
Converted to IDL V5.0 W. Landsman September 1997



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us