FromDMS
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 all close allBasic Examples (4)
Convert from a DMS list to an angle in decimal degrees:
FromDMS[{30., 10., 4.}]FromDMS["20°3'1.45''"]Convert from a DMS string with cardinal directions:
FromDMS["20°3'1.45\"S"]FromDMS["20°3'1.45\"N"]Convert from a latitude-longitude specification:
FromDMS["5°30'0''N 10°29'60.''W"]Scope (4)
Convert a DMS list into a numeric angle in degrees:
FromDMS[{27, 12, 3.45}]For exact input, the result is also an exact number:
FromDMS[{27, 12, 345 / 100}]FromDMS[{-27, -12, -3.45}]The sign can also be specified using a cardinal direction:
FromDMS[{27, 12, 3.45, "E"}]FromDMS[{27, 12, 3.45, "W"}]FromDMS[{27, 12, 3.45, "North"}]FromDMS[{27, 12, 3.45, "South"}]Convert a DMS string into a numeric angle in degrees:
FromDMS["23d11m49.92s"]The input can be given in multiple forms:
FromDMS["23deg11min49.92sec"]FromDMS["23° 11' 49.92''"]FromDMS["23 arcdegs 11 arcmins 49.92 arcsecs"]In this input, "23o" means 23 degrees and "11 MOA" means 11 minutes of arc:
FromDMS["23o 11 MOA 49.92"]Signs in a DMS string can also be specified using cardinal directions:
FromDMS["23d11m49.92s West"]FromDMS["23d11m49.92s S"]FromDMS["23d11m49.92s North"]Generalizations & Extensions (4)
Act on both angles of a double DMS string:
FromDMS["40d7m12s North, 88d14m24.s West"]The result always has {lat,lon} order:
FromDMS["88d14m24.s West, 40d7m12s North"]Indicate whether the input has latitude first or longitude first:
FromDMS["lat 40d7m12.5s, lon 88d14m24.s"]FromDMS["lon 88d14m24.s, lat 40d7m12.5s"]FromDMS on a numeric quantity interprets it as already being an angle in degrees:
FromDMS[345.2342]Convert a Quantity angle into a numeric angle in degrees:
FromDMS[Quantity[3.342387, "Radians"]]Properties & Relations (3)
If the input contains an inexact number, the result will be inexact:
FromDMS[{20., 10, 12}]FromDMS["20d 10.m 12s"]Only when all numbers are exact will the result be exact:
FromDMS[{20, 10, 12}]FromDMS["20deg 10min 12sec"]The action of FromDMS on a DMS list can be inverted with DMSList:
FromDMS[{34, 23, 14.78}]DMSList[%]FromDMS[{34, 23, (739/50)}]DMSList[%]The action of FromDMS on a DMS string can be inverted (modulo notation) with DMSString:
FromDMS["34deg 23min 14.78sec"]DMSString[%]FromDMS["34deg 23min 15sec"]DMSString[%]See Also
DMSList DMSString Degree GeodesyData GeoPosition GeoDistance
History
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_2026_fromdms, author="Wolfram Research", title="{FromDMS}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/FromDMS.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_fromdms, organization={Wolfram Research}, title={FromDMS}, year={2008}, url={https://reference.wolfram.com/language/ref/FromDMS.html}, note=[Accessed: 13-June-2026]}