>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  DMS2D






      Convert from Degrees, Minutes, and seconds to degrees.


Calling Sequence

      d = dms2d(s)


      s = input text string with deg, min, sec. in
        Ex: "3d 08m 30s" or "3 8 30" or "3:8:30".
        May have a leading negative sign: "-3d 08m 30s".

Keyword Parameters


        /NEWS Allow N, E, W, S in strings to indicate hemisphere.
          S or W give values < 0.
          Allows values like:'-33 27 15.2','33 27 15.2 S','S33 27 15.2','S 33 27 15.2',
            '-33.454222','33.454222 S','33.454222S','33S 27 15.2'.


      d = returned angle in degrees. out

Common Blocks


      Notes: scalar or array inputs. Units symbols ignored,
        first item assumed deg, 2nd minutes, 3rd seconds.

Modification History

      R. Sterner, 1998 Feb 3
      R. Sterner, 2002 Jan 30 --- Allowed inputs to be arrays.
      R. Sterner, 2002 Apr 26 --- Allowed dd:mm:ss form.
      R. Sterner, 2004 Jun 24 --- Allow negative sign.
      R. Sterner, 2010 Jan 19 --- Added /NEWS keyword.
  Copyright (C) 1998, 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.

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