-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcircle.h
155 lines (124 loc) · 3.26 KB
/
circle.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#ifndef __PGS_CIRCLE_H__
#define __PGS_CIRCLE_H__
#include "euler.h"
/* Spherical circle declarations */
/*
* Spherical circle data structure: center and radius.
*/
typedef struct
{
SPoint center; /* the center of circle */
float8 radius; /* the circle radius in radians */
} SCIRCLE;
/*
* Checks whether two circles are equal.
*/
bool scircle_eq(const SCIRCLE *c1, const SCIRCLE *c2);
/*
* Checks whether a circle contains a point.
*/
bool spoint_in_circle(const SPoint *p, const SCIRCLE *c);
/*
* Transforms a circle using an Euler transformation.
*/
void euler_scircle_trans(SCIRCLE *out, const SCIRCLE *in, const SEuler *se);
/*
* Takes the input and stores it as a spherical circle.
*/
Datum spherecircle_in(PG_FUNCTION_ARGS);
/*
* Checks whether two circles are equal.
*/
Datum spherecircle_equal(PG_FUNCTION_ARGS);
/*
* Checks whether two circles are not equal.
*/
Datum spherecircle_equal_neg(PG_FUNCTION_ARGS);
/*
* Calculate the distance of two circles. If they overlap, this function
* returns 0.0.
*/
Datum spherecircle_distance(PG_FUNCTION_ARGS);
/*
* Calculate the distance of a circle and a point. If a circle contains a point,
* this function returns 0.0.
*/
Datum spherecircle_point_distance(PG_FUNCTION_ARGS);
/*
* Calculate the distance of a point and a circle. If a circle contains a point,
* this function returns 0.0.
*/
Datum spherecircle_point_distance_com(PG_FUNCTION_ARGS);
/*
* Checks whether a circle contains a point.
*/
Datum spherepoint_in_circle(PG_FUNCTION_ARGS);
/*
* Checks whether a circle doesn't contain a point.
*/
Datum spherepoint_in_circle_neg(PG_FUNCTION_ARGS);
/*
* Checks whether a circle contains a point.
*/
Datum spherepoint_in_circle_com(PG_FUNCTION_ARGS);
/*
* Checks whether a circle doesn't contain a point.
*/
Datum spherepoint_in_circle_com_neg(PG_FUNCTION_ARGS);
/*
* Checks whether a circle is contained by other circle.
*/
Datum spherecircle_in_circle(PG_FUNCTION_ARGS);
/*
* Checks whether a circle is not contained by other circle.
*/
Datum spherecircle_in_circle_neg(PG_FUNCTION_ARGS);
/*
* Checks whether a circle contains other circle.
*/
Datum spherecircle_in_circle_com(PG_FUNCTION_ARGS);
/*
* Checks whether circle does not contain other circle.
*/
Datum spherecircle_in_circle_com_neg(PG_FUNCTION_ARGS);
/*
* Checks whether two circles overlap.
*/
Datum spherecircle_overlap(PG_FUNCTION_ARGS);
/*
* Checks whether two circles overlap.
*/
Datum spherecircle_overlap_neg(PG_FUNCTION_ARGS);
/*
* Returns the center of a circle.
*/
Datum spherecircle_center(PG_FUNCTION_ARGS);
/*
* Returns the radius of a circle.
*/
Datum spherecircle_radius(PG_FUNCTION_ARGS);
/*
* Converts a point to a circle.
*/
Datum spherepoint_to_circle(PG_FUNCTION_ARGS);
/*
* Creates a circle from center and radius.
*/
Datum spherecircle_by_center(PG_FUNCTION_ARGS);
/*
* Calculates the area of a circle in square radians.
*/
Datum spherecircle_area(PG_FUNCTION_ARGS);
/*
* Calculates the circumference of a circle in radians.
*/
Datum spherecircle_circ(PG_FUNCTION_ARGS);
/*
* Transforms a circle using an Euler transformation.
*/
Datum spheretrans_circle(PG_FUNCTION_ARGS);
/*
* Inverse transformation of a circle using an Euler transformation.
*/
Datum spheretrans_circle_inverse(PG_FUNCTION_ARGS);
#endif