FromDMS

FromDMS[{d,m,s}]

converts from degrees, minutes, and seconds to decimal degrees.

FromDMS["dms"]

converts from a DMS string to decimal degrees.

FromDMS["latlon"]

converts from a latitude-longitude string to latitude and longitude in decimal degrees.

Details

  • FromDMS["dms"] supports all common DMS string formats, with delimiters such as °, ', ", and d, m, s.
  • FromDMS["dms"] allows strings containing cardinal directions N, S, E, W. N and E give positive angles; S and W give negative angles.
  • FromDMS["latlon"] supports latitude-longitude formats, with or without cardinal directions explicitly specified.
  • Results in decimal degrees can be converted to radians by multiplying by Degree.

Examples

open allclose all

Basic Examples  (4)

Convert from a DMS list to an angle in decimal degrees:

Convert from a DMS string:

Convert from a DMS string with cardinal directions:

Convert from a latitude-longitude specification:

Scope  (4)

Convert a DMS list into a numeric angle in degrees:

For exact input, the result is also an exact number:

A signed angle:

The sign can also be specified using a cardinal direction:

Convert a DMS string into a numeric angle in degrees:

The input can be given in multiple forms:

Signs in a DMS string can also be specified using cardinal directions:

Generalizations & Extensions  (4)

Act on both angles of a double DMS string:

The result always has {lat,lon} order:

Indicate whether the input has latitude first or longitude first:

FromDMS on a numeric quantity interprets it as already being an angle in degrees:

Convert a Quantity angle into a numeric angle in degrees:

Properties & Relations  (3)

If the input contains an inexact number, the result will be inexact:

Only when all numbers are exact will the result be exact:

The action of FromDMS on a DMS list can be inverted with DMSList:

With exact numbers:

The action of FromDMS on a DMS string can be inverted (modulo notation) with DMSString:

With exact numbers:

Wolfram Research (2008), FromDMS, Wolfram Language function, https://reference.wolfram.com/language/ref/FromDMS.html.

Text

Wolfram Research (2008), FromDMS, Wolfram Language function, https://reference.wolfram.com/language/ref/FromDMS.html.

CMS

Wolfram Language. 2008. "FromDMS." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FromDMS.html.

APA

Wolfram Language. (2008). FromDMS. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FromDMS.html

BibTeX

@misc{reference.wolfram_2024_fromdms, author="Wolfram Research", title="{FromDMS}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/FromDMS.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_fromdms, organization={Wolfram Research}, title={FromDMS}, year={2008}, url={https://reference.wolfram.com/language/ref/FromDMS.html}, note=[Accessed: 22-November-2024 ]}