source: trunk/FACT++/sofa/src/anpm.c@ 18355

Last change on this file since 18355 was 18346, checked in by tbretz, 11 years ago
File size: 4.9 KB
Line 
1#include "sofa.h"
2
3double iauAnpm(double a)
4/*
5** - - - - - - - -
6** i a u A n p m
7** - - - - - - - -
8**
9** Normalize angle into the range -pi <= a < +pi.
10**
11** This function is part of the International Astronomical Union's
12** SOFA (Standards Of Fundamental Astronomy) software collection.
13**
14** Status: vector/matrix support function.
15**
16** Given:
17** a double angle (radians)
18**
19** Returned (function value):
20** double angle in range +/-pi
21**
22** This revision: 2013 June 18
23**
24** SOFA release 2015-02-09
25**
26** Copyright (C) 2015 IAU SOFA Board. See notes at end.
27*/
28{
29 double w;
30
31 w = fmod(a, D2PI);
32 if (fabs(w) >= DPI) w -= dsign(D2PI, a);
33
34 return w;
35
36/*----------------------------------------------------------------------
37**
38** Copyright (C) 2015
39** Standards Of Fundamental Astronomy Board
40** of the International Astronomical Union.
41**
42** =====================
43** SOFA Software License
44** =====================
45**
46** NOTICE TO USER:
47**
48** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
49** CONDITIONS WHICH APPLY TO ITS USE.
50**
51** 1. The Software is owned by the IAU SOFA Board ("SOFA").
52**
53** 2. Permission is granted to anyone to use the SOFA software for any
54** purpose, including commercial applications, free of charge and
55** without payment of royalties, subject to the conditions and
56** restrictions listed below.
57**
58** 3. You (the user) may copy and distribute SOFA source code to others,
59** and use and adapt its code and algorithms in your own software,
60** on a world-wide, royalty-free basis. That portion of your
61** distribution that does not consist of intact and unchanged copies
62** of SOFA source code files is a "derived work" that must comply
63** with the following requirements:
64**
65** a) Your work shall be marked or carry a statement that it
66** (i) uses routines and computations derived by you from
67** software provided by SOFA under license to you; and
68** (ii) does not itself constitute software provided by and/or
69** endorsed by SOFA.
70**
71** b) The source code of your derived work must contain descriptions
72** of how the derived work is based upon, contains and/or differs
73** from the original SOFA software.
74**
75** c) The names of all routines in your derived work shall not
76** include the prefix "iau" or "sofa" or trivial modifications
77** thereof such as changes of case.
78**
79** d) The origin of the SOFA components of your derived work must
80** not be misrepresented; you must not claim that you wrote the
81** original software, nor file a patent application for SOFA
82** software or algorithms embedded in the SOFA software.
83**
84** e) These requirements must be reproduced intact in any source
85** distribution and shall apply to anyone to whom you have
86** granted a further right to modify the source code of your
87** derived work.
88**
89** Note that, as originally distributed, the SOFA software is
90** intended to be a definitive implementation of the IAU standards,
91** and consequently third-party modifications are discouraged. All
92** variations, no matter how minor, must be explicitly marked as
93** such, as explained above.
94**
95** 4. You shall not cause the SOFA software to be brought into
96** disrepute, either by misuse, or use for inappropriate tasks, or
97** by inappropriate modification.
98**
99** 5. The SOFA software is provided "as is" and SOFA makes no warranty
100** as to its use or performance. SOFA does not and cannot warrant
101** the performance or results which the user may obtain by using the
102** SOFA software. SOFA makes no warranties, express or implied, as
103** to non-infringement of third party rights, merchantability, or
104** fitness for any particular purpose. In no event will SOFA be
105** liable to the user for any consequential, incidental, or special
106** damages, including any lost profits or lost savings, even if a
107** SOFA representative has been advised of such damages, or for any
108** claim by any third party.
109**
110** 6. The provision of any version of the SOFA software under the terms
111** and conditions specified herein does not imply that future
112** versions will also be made available under the same terms and
113** conditions.
114*
115** In any published work or commercial product which uses the SOFA
116** software directly, acknowledgement (see www.iausofa.org) is
117** appreciated.
118**
119** Correspondence concerning SOFA software should be addressed as
120** follows:
121**
122** By email: sofa@ukho.gov.uk
123** By post: IAU SOFA Center
124** HM Nautical Almanac Office
125** UK Hydrographic Office
126** Admiralty Way, Taunton
127** Somerset, TA1 2DN
128** United Kingdom
129**
130**--------------------------------------------------------------------*/
131}
Note: See TracBrowser for help on using the repository browser.