-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathswhaspect.h
137 lines (124 loc) · 3.92 KB
/
swhaspect.h
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
Swephelp
Copyright 2007-2020 Stanislas Marquis <[email protected]>
Swephelp is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
Swephelp 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Swephelp. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SWHASPECT_H
#define SWHASPECT_H
#ifdef __cplusplus
extern "C"
{
#endif
/** @brief Aspect matching - aspect in range [0;360[
*
* Check if the two given positions match the aspect within the given orb.
*
* This also calculates the difference between targeted aspect and objects
* distance (so that pos0 + asp + diffret = pos2), and its speed (so that
* a negative speed indicates an applying aspect). Returned factor simply
* is that difference expressed in orb units (so that orb * facret = diffret).
*
* If you are not interested in that mumbo-jumbo, just set objects speeds to
* zero, and consider only the value returned by the function.
*
* @param pos0 First object longitude, in degrees [0;360[
* @param speed0 First object longitude speed, in degrees per day
* @param pos1 Second object longitude, in degrees [0;360[
* @param speed1 Second object longitude speed, in degrees per day
* @param aspect Aspect targeted, in degrees [0;360[
* @param orb Orb allowed, in degrees
* @param diffret Difference between aspect and objects distance, in degrees
* @param speedret Difference speed, in degrees per day
* @param facret Difference expressed in orb units
* @return 0 if aspect match within orb, else 1
*/
int swh_match_aspect(
double pos0,
double speed0,
double pos1,
double speed1,
double aspect,
double orb,
double* diffret,
double* speedret,
double* facret);
/** @brief Aspect matching - aspect in range [0;180]
*
* Same as swh_match_aspect, but aspect in [0;180], instead of [0;360[
*
* @see swh_match_aspect()
*/
int swh_match_aspect2(
double pos0,
double speed0,
double pos1,
double speed1,
double aspect,
double orb,
double* diffret,
double* speedret,
double* facret);
/** @brief Aspect matching - aspect in range [0;360[ and complex orb
*
* Same as swh_match_aspect, but with a different orb in case aspect is
* applying, separating, or stable.
*
* @see swh_match_aspect()
*/
int swh_match_aspect3(
double pos0,
double speed0,
double pos1,
double speed1,
double aspect,
double app_orb,
double sep_orb,
double def_orb,
double* diffret,
double* speedret,
double* facret);
/** @brief Aspect matching - aspect in range [0;180] and complex orb
*
* Same as swh_match_aspect2, but with a different orb in case aspect is
* applying, separating, or stable.
*
* @see swh_match_aspect2()
*/
int swh_match_aspect4(
double pos0,
double speed0,
double pos1,
double speed1,
double aspect,
double app_orb,
double sep_orb,
double def_orb,
double* diffret,
double* speedret,
double* facret);
/** @brief Calculate antiscion and contrantiscion
*
* @param pos Object positions and speeds, as returned by swe_calc functions
* @param axis Degree of axis, eg. 90 for 0° cancer-capricorn
* @param antisret Returned antiscion positions, declared as double[6]
* @param contrantisret Returned contrantiscion positions, declared as double[6]
*/
void swh_antiscion(
const double pos[6],
const double axis,
double antisret[6],
double contrantisret[6]);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SWHASPECT_H */
/* vi: set fenc=utf-8 ff=unix et sw=4 ts=4 : */