source: branches/FACT++_lidctrl_usb/erfa/src/p2s.c@ 19758

Last change on this file since 19758 was 18711, checked in by tbretz, 8 years ago
Updated to ERFA 1.3.0 (no relevant code change except the leap second at the beginning of 2017)
File size: 3.7 KB
Line 
1#include "erfa.h"
2
3void eraP2s(double p[3], double *theta, double *phi, double *r)
4/*
5** - - - - - - -
6** e r a P 2 s
7** - - - - - - -
8**
9** P-vector to spherical polar coordinates.
10**
11** Given:
12** p double[3] p-vector
13**
14** Returned:
15** theta double longitude angle (radians)
16** phi double latitude angle (radians)
17** r double radial distance
18**
19** Notes:
20**
21** 1) If P is null, zero theta, phi and r are returned.
22**
23** 2) At either pole, zero theta is returned.
24**
25** Called:
26** eraC2s p-vector to spherical
27** eraPm modulus of p-vector
28**
29** Copyright (C) 2013-2016, NumFOCUS Foundation.
30** Derived, with permission, from the SOFA library. See notes at end of file.
31*/
32{
33 eraC2s(p, theta, phi);
34 *r = eraPm(p);
35
36 return;
37
38}
39/*----------------------------------------------------------------------
40**
41**
42** Copyright (C) 2013-2016, NumFOCUS Foundation.
43** All rights reserved.
44**
45** This library is derived, with permission, from the International
46** Astronomical Union's "Standards of Fundamental Astronomy" library,
47** available from http://www.iausofa.org.
48**
49** The ERFA version is intended to retain identical functionality to
50** the SOFA library, but made distinct through different function and
51** file names, as set out in the SOFA license conditions. The SOFA
52** original has a role as a reference standard for the IAU and IERS,
53** and consequently redistribution is permitted only in its unaltered
54** state. The ERFA version is not subject to this restriction and
55** therefore can be included in distributions which do not support the
56** concept of "read only" software.
57**
58** Although the intent is to replicate the SOFA API (other than
59** replacement of prefix names) and results (with the exception of
60** bugs; any that are discovered will be fixed), SOFA is not
61** responsible for any errors found in this version of the library.
62**
63** If you wish to acknowledge the SOFA heritage, please acknowledge
64** that you are using a library derived from SOFA, rather than SOFA
65** itself.
66**
67**
68** TERMS AND CONDITIONS
69**
70** Redistribution and use in source and binary forms, with or without
71** modification, are permitted provided that the following conditions
72** are met:
73**
74** 1 Redistributions of source code must retain the above copyright
75** notice, this list of conditions and the following disclaimer.
76**
77** 2 Redistributions in binary form must reproduce the above copyright
78** notice, this list of conditions and the following disclaimer in
79** the documentation and/or other materials provided with the
80** distribution.
81**
82** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
83** the International Astronomical Union nor the names of its
84** contributors may be used to endorse or promote products derived
85** from this software without specific prior written permission.
86**
87** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
88** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
89** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
90** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
91** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
92** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
93** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
94** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
95** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
96** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
97** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
98** POSSIBILITY OF SUCH DAMAGE.
99**
100*/
Note: See TracBrowser for help on using the repository browser.