(deg)
¶Convert decimal degrees into degrees, minutes, and seconds components.
degrees2dms separates the fractional part of angles and converts them into minutes and seconds. The degree values are converted into decimal degrees.
Input can be a real-valued scalar or column vector. Row vectors are accepted as well but will be transposed before processing.
The output comprises a nx3 matrix of double. Each output row corresponds to one angle of the input vector: the first and second columns are the degree and minute components, respectively (both integers), and the third to the seconds (which may have a fractional part). The minutes and seconds always have magnitudes less than 60. The signs of output components not after a nonzero output component match the sign of the input, and any other output components have positive sign.
degrees2dms (10 + 30/60 + 56.25/3600) ⇒ [ 10 30 56.25 ]
The sign of the first nonzero output component matches the sign of the input, and the other output components are not less than zero.
angles = [ 10.5 -10.5 -0.5 0.5 ]; degrees2dms (angles) ⇒ 10 30 0 -10 30 0 0 -30 0 0 30 0
See also: degrees2dm, dm2degrees, dms2degrees.
Package: mapping