|
3 | 3 |
|
4 | 4 | #include "euler.h" |
5 | 5 |
|
6 | | - /* |
7 | | - * Spherical circle declarations |
8 | | - */ |
| 6 | +/* |
| 7 | + * Spherical circle declarations |
| 8 | + */ |
9 | 9 |
|
10 | | - /* |
11 | | - * Spherical circle data structure: center and radius. |
12 | | - */ |
| 10 | +/* |
| 11 | + * Spherical circle data structure: center and radius. |
| 12 | + */ |
13 | 13 | typedef struct |
14 | 14 | { |
15 | 15 | SPoint center; /* the center of circle */ |
16 | 16 | float8 radius; /* the circle radius in radians */ |
17 | 17 | } SCIRCLE; |
18 | 18 |
|
19 | | - /* |
20 | | - * Checks whether two circles are equal. |
21 | | - */ |
| 19 | +/* |
| 20 | + * Checks whether two circles are equal. |
| 21 | + */ |
22 | 22 | bool scircle_eq(const SCIRCLE *c1, const SCIRCLE *c2); |
23 | 23 |
|
24 | | - /* |
25 | | - * Checks whether circle contains point. |
26 | | - */ |
| 24 | +/* |
| 25 | + * Checks whether circle contains point. |
| 26 | + */ |
27 | 27 | bool spoint_in_circle(const SPoint *p, const SCIRCLE *c); |
28 | 28 |
|
29 | | - /* |
30 | | - * Transforms a circle using Euler transformation. |
31 | | - */ |
32 | | -SCIRCLE *euler_scircle_trans(SCIRCLE *out, const SCIRCLE *in, const SEuler *se); |
| 29 | +/* |
| 30 | + * Transforms a circle using Euler transformation. |
| 31 | + */ |
| 32 | +void euler_scircle_trans(SCIRCLE *out, const SCIRCLE *in, const SEuler *se); |
33 | 33 |
|
34 | | - /* |
35 | | - * Takes the input and stores it as spherical circle. |
36 | | - */ |
| 34 | +/* |
| 35 | + * Takes the input and stores it as spherical circle. |
| 36 | + */ |
37 | 37 | Datum spherecircle_in(PG_FUNCTION_ARGS); |
38 | 38 |
|
39 | | - /* |
40 | | - * Checks whether two circles are equal. |
41 | | - */ |
| 39 | +/* |
| 40 | + * Checks whether two circles are equal. |
| 41 | + */ |
42 | 42 | Datum spherecircle_equal(PG_FUNCTION_ARGS); |
43 | 43 |
|
44 | | - /* |
45 | | - * Checks whether two circles are not equal. |
46 | | - */ |
| 44 | +/* |
| 45 | + * Checks whether two circles are not equal. |
| 46 | + */ |
47 | 47 | Datum spherecircle_equal_neg(PG_FUNCTION_ARGS); |
48 | 48 |
|
49 | | - /* |
50 | | - * Calculate the distance of two circles. If overlapping, this function |
51 | | - * returns 0.0. |
52 | | - */ |
| 49 | +/* |
| 50 | + * Calculate the distance of two circles. If overlapping, this function |
| 51 | + * returns 0.0. |
| 52 | + */ |
53 | 53 | Datum spherecircle_distance(PG_FUNCTION_ARGS); |
54 | 54 |
|
55 | | - /* |
56 | | - * Calculate the distance of circle and point. If circle contains point, |
57 | | - * this function returns 0.0. |
58 | | - */ |
| 55 | +/* |
| 56 | + * Calculate the distance of circle and point. If circle contains point, |
| 57 | + * this function returns 0.0. |
| 58 | + */ |
59 | 59 | Datum spherecircle_point_distance(PG_FUNCTION_ARGS); |
60 | 60 |
|
61 | | - /* |
62 | | - * Calculate the distance of point and circle. If circle contains point, |
63 | | - * this function returns 0.0. |
64 | | - */ |
| 61 | +/* |
| 62 | + * Calculate the distance of point and circle. If circle contains point, |
| 63 | + * this function returns 0.0. |
| 64 | + */ |
65 | 65 | Datum spherecircle_point_distance_com(PG_FUNCTION_ARGS); |
66 | 66 |
|
67 | | - /* |
68 | | - * Checks whether circle contains point. |
69 | | - */ |
| 67 | +/* |
| 68 | + * Checks whether circle contains point. |
| 69 | + */ |
70 | 70 | Datum spherepoint_in_circle(PG_FUNCTION_ARGS); |
71 | 71 |
|
72 | | - /* |
73 | | - * Checks whether circle doesn't contain point. |
74 | | - */ |
| 72 | +/* |
| 73 | + * Checks whether circle doesn't contain point. |
| 74 | + */ |
75 | 75 | Datum spherepoint_in_circle_neg(PG_FUNCTION_ARGS); |
76 | 76 |
|
77 | | - /* |
78 | | - * Checks whether circle contains point. |
79 | | - */ |
| 77 | +/* |
| 78 | + * Checks whether circle contains point. |
| 79 | + */ |
80 | 80 | Datum spherepoint_in_circle_com(PG_FUNCTION_ARGS); |
81 | 81 |
|
82 | | - /* |
83 | | - * Checks whether circle doesn't contain point. |
84 | | - */ |
| 82 | +/* |
| 83 | + * Checks whether circle doesn't contain point. |
| 84 | + */ |
85 | 85 | Datum spherepoint_in_circle_com_neg(PG_FUNCTION_ARGS); |
86 | 86 |
|
87 | | - /* |
88 | | - * Checks whether circle is contained by other circle. |
89 | | - */ |
| 87 | +/* |
| 88 | + * Checks whether circle is contained by other circle. |
| 89 | + */ |
90 | 90 | Datum spherecircle_in_circle(PG_FUNCTION_ARGS); |
91 | 91 |
|
92 | | - /* |
93 | | - * Checks whether circle is not contained by other circle. |
94 | | - */ |
| 92 | +/* |
| 93 | + * Checks whether circle is not contained by other circle. |
| 94 | + */ |
95 | 95 | Datum spherecircle_in_circle_neg(PG_FUNCTION_ARGS); |
96 | 96 |
|
97 | | - /* |
98 | | - * Checks whether circle contains other circle. |
99 | | - */ |
| 97 | +/* |
| 98 | + * Checks whether circle contains other circle. |
| 99 | + */ |
100 | 100 | Datum spherecircle_in_circle_com(PG_FUNCTION_ARGS); |
101 | 101 |
|
102 | | - /* |
103 | | - * Checks whether circle does not contain other circle. |
104 | | - */ |
| 102 | +/* |
| 103 | + * Checks whether circle does not contain other circle. |
| 104 | + */ |
105 | 105 | Datum spherecircle_in_circle_com_neg(PG_FUNCTION_ARGS); |
106 | 106 |
|
107 | | - /* |
108 | | - * Checks whether two circle overlap. |
109 | | - */ |
| 107 | +/* |
| 108 | + * Checks whether two circle overlap. |
| 109 | + */ |
110 | 110 | Datum spherecircle_overlap(PG_FUNCTION_ARGS); |
111 | 111 |
|
112 | | - /* |
113 | | - * Checks whether two circle overlap. |
114 | | - */ |
| 112 | +/* |
| 113 | + * Checks whether two circle overlap. |
| 114 | + */ |
115 | 115 | Datum spherecircle_overlap_neg(PG_FUNCTION_ARGS); |
116 | 116 |
|
117 | | - /* |
118 | | - * Returns the center of circle. |
119 | | - */ |
| 117 | +/* |
| 118 | + * Returns the center of circle. |
| 119 | + */ |
120 | 120 | Datum spherecircle_center(PG_FUNCTION_ARGS); |
121 | 121 |
|
122 | | - /* |
123 | | - * Returns the radius of circle. |
124 | | - */ |
| 122 | +/* |
| 123 | + * Returns the radius of circle. |
| 124 | + */ |
125 | 125 | Datum spherecircle_radius(PG_FUNCTION_ARGS); |
126 | 126 |
|
127 | | - /* |
128 | | - * Converts a point to a circle. |
129 | | - */ |
| 127 | +/* |
| 128 | + * Converts a point to a circle. |
| 129 | + */ |
130 | 130 | Datum spherepoint_to_circle(PG_FUNCTION_ARGS); |
131 | 131 |
|
132 | | - /* |
133 | | - * Creates a circle from center and radius. |
134 | | - */ |
| 132 | +/* |
| 133 | + * Creates a circle from center and radius. |
| 134 | + */ |
135 | 135 | Datum spherecircle_by_center(PG_FUNCTION_ARGS); |
136 | 136 |
|
137 | | - /* |
138 | | - * Calculates the area of a circle in square radians. |
139 | | - */ |
| 137 | +/* |
| 138 | + * Calculates the area of a circle in square radians. |
| 139 | + */ |
140 | 140 | Datum spherecircle_area(PG_FUNCTION_ARGS); |
141 | 141 |
|
142 | | - /* |
143 | | - * Calculates the circumference of a circle in radians. |
144 | | - */ |
| 142 | +/* |
| 143 | + * Calculates the circumference of a circle in radians. |
| 144 | + */ |
145 | 145 | Datum spherecircle_circ(PG_FUNCTION_ARGS); |
146 | 146 |
|
147 | | - /* |
148 | | - * Transforms a circle using Euler transformation. |
149 | | - */ |
| 147 | +/* |
| 148 | + * Transforms a circle using Euler transformation. |
| 149 | + */ |
150 | 150 | Datum spheretrans_circle(PG_FUNCTION_ARGS); |
151 | 151 |
|
152 | | - /* |
153 | | - * Inverse transformation of a circle using Euler transformation. |
154 | | - */ |
| 152 | +/* |
| 153 | + * Inverse transformation of a circle using Euler transformation. |
| 154 | + */ |
155 | 155 | Datum spheretrans_circle_inverse(PG_FUNCTION_ARGS); |
156 | 156 |
|
157 | 157 | #endif |
0 commit comments