@@ -50,11 +50,11 @@ PG_FUNCTION_INFO_V1(spheretrans_ellipse);
50
50
PG_FUNCTION_INFO_V1 (spheretrans_ellipse_inv );
51
51
52
52
53
- /*
54
- * ! This function returns the arc cos of a value. If variable a is outside
55
- * the range between -1.00 and 1.00, the function returns corresponding PI/2
56
- * or 3*PI/2. \param a the arccos argument \return arccos of a value
57
- */
53
+ /*
54
+ * This function returns the arccos of a value. If variable a is outside
55
+ * the range between -1.00 and 1.00, the function returns corresponding PI/2
56
+ * or 3*PI/2.
57
+ */
58
58
static float8
59
59
my_acos (float8 a )
60
60
{
@@ -65,10 +65,9 @@ my_acos(float8 a)
65
65
return acos (a );
66
66
}
67
67
68
- /*
69
- * ! \brief Checks the parameter of an ellipse \param e pointer to ellipse
70
- * \return pointer of (modified) ellipse
71
- */
68
+ /*
69
+ * Checks the parameter of an ellipse.
70
+ */
72
71
static SELLIPSE *
73
72
sellipse_check (SELLIPSE * e )
74
73
{
@@ -95,11 +94,9 @@ sellipse_check(SELLIPSE *e)
95
94
return e ;
96
95
}
97
96
98
-
99
- /*
100
- * ! \brief Returns the boundary circle of an ellipse \param e pointer to
101
- * ellipse \param sc pointer to circle \return pointer to result circle
102
- */
97
+ /*
98
+ * Returns the boundary circle of an ellipse.
99
+ */
103
100
static SCIRCLE *
104
101
sellipse_circle (SCIRCLE * sc , const SELLIPSE * e )
105
102
{
@@ -111,14 +108,10 @@ sellipse_circle(SCIRCLE *sc, const SELLIPSE *e)
111
108
return sc ;
112
109
}
113
110
114
-
115
- /*
116
- * ! \brief Returns the an ellipse from axes, center and inclination \param
117
- * r1 first axis length in radians \param r2 second axis length in radians
118
- * \param c pointer to center of ellipse \param inc inclination of ellipse
119
- * in radians \note The largest axis length is choosen for large axis \return
120
- * pointer to ellipse
121
- */
111
+ /*
112
+ * Returns the an ellipse from axes, center and inclination. The largest axis
113
+ * length is chosen for large axis.
114
+ */
122
115
static SELLIPSE *
123
116
sellipse_in (float8 r1 , float8 r2 , const SPoint * c , float8 inc )
124
117
{
@@ -142,11 +135,13 @@ sellipse_in(float8 r1, float8 r2, const SPoint *c, float8 inc)
142
135
return (e );
143
136
}
144
137
145
- /*
146
- * ! \brief Returns the radius of an ellipse depending on position angle
147
- * \param rada major axis length \param radb minor axis length \param ang
148
- * position angle in radians \return radius of ellipse in radians
149
- */
138
+ /*---
139
+ * Returns the radius of an ellipse depending on position angle.
140
+ *
141
+ * rada - major axis length
142
+ * radb - minor axis length
143
+ * ang - position angle in radians
144
+ */
150
145
static float8
151
146
sellipse_dist (float8 rada , float8 radb , float8 ang )
152
147
{
@@ -156,22 +151,15 @@ sellipse_dist(float8 rada, float8 radb, float8 ang)
156
151
return (asin (sin (radb ) / sqrt (1 - e * Sqr (cos (ang )))));
157
152
}
158
153
159
-
160
-
161
-
162
- /*
163
- * ! \brief Returns distance between ellipse and point \param se pointer to
164
- * ellipse \param sp pointer to point \return distance in radians \note
165
- * returns -1.0 if ellipse contains point
166
- */
154
+ /*
155
+ * Returns distance between ellipse and point.
156
+ */
167
157
static float8
168
158
sellipse_point_dist (const SELLIPSE * se , const SPoint * sp )
169
159
{
170
160
static SEuler e ;
171
161
static SPoint p ;
172
- static float8 dist ,
173
- rad ,
174
- ang ;
162
+ static float8 dist , rad , ang ;
175
163
176
164
sellipse_trans (& e , se );
177
165
spheretrans_inv (& e );
@@ -208,11 +196,9 @@ sellipse_point_dist(const SELLIPSE *se, const SPoint *sp)
208
196
return -1.0 ;
209
197
}
210
198
211
- /*
212
- * ! \brief Does an Euler transformation of ellipse \param out pointer to
213
- * transformed ellipse \param in pointer to input ellipse \param se pointer
214
- * to Euler transformation \return pointer to transformed ellipse
215
- */
199
+ /*
200
+ * Does an Euler transformation of ellipse.
201
+ */
216
202
static SELLIPSE *
217
203
euler_sellipse_trans (SELLIPSE * out , const SELLIPSE * in , const SEuler * se )
218
204
{
@@ -245,12 +231,10 @@ euler_sellipse_trans(SELLIPSE *out, const SELLIPSE *in, const SEuler *se)
245
231
}
246
232
247
233
248
- /*
249
- * ! \brief Returns the relationship between two ellipses \param se1 pointer
250
- * to first ellipse \param se2 pointer to second ellipse \return
251
- * relationship as a \link PGS_ELLIPSE_ELLIPSE_REL int8 value \endlink (\ref
252
- * PGS_ELLIPSE_ELLIPSE_REL )
253
- */
234
+ /*
235
+ * Returns the relationship between two ellipses as PGS_ELLIPSE_ELLIPSE_REL
236
+ * int8 value.
237
+ */
254
238
static int8
255
239
sellipse_ellipse_pos (const SELLIPSE * se1 , const SELLIPSE * se2 )
256
240
{
@@ -288,7 +272,6 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
288
272
}
289
273
290
274
/* se1 is circle or point */
291
-
292
275
if (FPeq (se1 -> rad [0 ], se1 -> rad [1 ]))
293
276
{
294
277
@@ -313,7 +296,6 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
313
296
}
314
297
315
298
/* se2 is line */
316
-
317
299
if (FPzero (se2 -> rad [1 ]))
318
300
{
319
301
static SLine l ;
@@ -335,7 +317,6 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
335
317
}
336
318
337
319
/* se1 is line */
338
-
339
320
if (FPzero (se1 -> rad [1 ]))
340
321
{
341
322
static SLine l ;
@@ -357,12 +338,10 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
357
338
}
358
339
359
340
/* now we have two real ellipses */
360
-
361
341
do
362
342
{
363
343
364
- static SPoint p1 ,
365
- p2 ;
344
+ static SPoint p1 , p2 ;
366
345
static float8 dist ;
367
346
368
347
/* check inner and outer circles */
@@ -380,20 +359,18 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
380
359
else if (FPle ((dist + se2 -> rad [0 ]), se1 -> rad [1 ]))
381
360
{
382
361
return PGS_ELLIPSE_CONT ;
383
-
384
362
}
385
363
else
386
364
{
387
365
388
- static SEuler eul ;
389
- static SELLIPSE etmp ,
390
- e ;
391
- static SPoint sp [3 ];
392
- static int i ;
393
- static float8 diff [3 ];
394
- static float8 elng ;
395
- static const int maxcntr = 100000 ;
396
- static int cntr ;
366
+ static SEuler eul ;
367
+ static SELLIPSE etmp , e ;
368
+ static SPoint sp [3 ];
369
+ static int i ;
370
+ static float8 diff [3 ];
371
+ static float8 elng ;
372
+ static const int maxcntr = 100000 ;
373
+ static int cntr ;
397
374
398
375
/* transform se1 to north pol */
399
376
sellipse_trans (& eul , se1 );
@@ -416,7 +393,6 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
416
393
417
394
418
395
/* search for minimum distance */
419
-
420
396
sp [0 ].lat = sp [2 ].lat = PIH - se1 -> rad [0 ];
421
397
sellipse_center (& sp [1 ], & e );
422
398
@@ -445,7 +421,6 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
445
421
cntr = 0 ;
446
422
do
447
423
{
448
-
449
424
for (i = 0 ; i < 3 ; i ++ )
450
425
{
451
426
diff [i ] = sellipse_point_dist (& e , & sp [i ]);
@@ -521,7 +496,6 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2)
521
496
{
522
497
return PGS_ELLIPSE_AVOID ;
523
498
}
524
-
525
499
}
526
500
} while (0 );
527
501
@@ -741,7 +715,6 @@ sellipse_line_pos(const SELLIPSE *se, const SLine *sl)
741
715
}
742
716
743
717
/* begin or end of line inside ellipse */
744
-
745
718
{
746
719
bool bb ,
747
720
be ;
0 commit comments