File: dms2d

package info (click to toggle)
calc 2.15.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,848 kB
  • sloc: ansic: 62,147; makefile: 7,664; sh: 503; awk: 74; sed: 7
file content (82 lines) | stat: -rw-r--r-- 2,452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
NAME
    dm2d, dms2d - convert degrees, minutes, and seconds to degrees

SYNOPSIS
    dm2d(d, m [,rnd])
    dms2d(d, m, s [,rnd])

TYPES
    d           real
    m           real
    s           real (defaults to 0)
    rnd         nonnegative integer, defaults to config("mod")

    return      degrees

DESCRIPTION
    Convert degrees, m minutes, and s seconds returning degrees.

    The return value in degrees, is equivalent to the following:

        mod(d + m/60 + s/3600, 360, rnd);

    Depending on the rounding mode, the return could be a real value
    in the interval [0, 360) or a real value in the interval (-360, 0].
    For the default round mode, the return value is in the interval [0, 360).

    A missing rnd defaults to config("mod").
    For more information on the effects of rnd, see "help mod".

    The dm2d(d, m, rnd) builtin is an alias for dms2d(d, m, 0, rnd).

EXAMPLE
    ; print dm2d(203, 325.5594);
    208.42599
    ; print dm2d(3601, -25.5594);
    0.57401
    ; print dm2d(-923, -25.5594);
    156.57401

    ; print dms2d(12, 20, 44.16);
    12.3456
    ; print dms2d(123.456, -345.68, 4.08);
    117.6958
    ; print dms2d(-65, -40, -44.4);
    294.321

    ; print dm2d(203, 325.5594, 1);
    -151.57401
    ; print dms2d(12, 20, 44.16, 1);
    -347.6544

LIMITS
    none

LINK LIBRARY
    none

SEE ALSO
    config, d2dm, d2dms, dm2d, dms2d, g2gm, g2gms, gm2g, gms2g,
    h2hm, h2hms, hm2d, hms2d, mod

## Copyright (C) 2021  Landon Curt Noll
##
## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License
## as published by the Free Software Foundation.
##
## Calc is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
## Public License for more details.
##
## A copy of version 2.1 of the GNU Lesser General Public License is
## distributed with calc under the filename COPYING-LGPL.  You should have
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
##
## Under source code control:   2021/09/25 17:24:51
## File existed as early as:    2021
##
## chongo <was here> /\oo/\     http://www.isthe.com/chongo/
## Share and enjoy!  :-)        http://www.isthe.com/chongo/tech/comp/calc/