@@ -68,7 +68,7 @@ double rot[7][2][2] = ROT;
68
68
/**
69
69
NOTES: Alex Raichev implemented the math in python and this is a port of his work.
70
70
The healpix projection is a Lambert cylindrical equal-area projection for
71
- equaltorial latitudes and an interrupted Colignon projection for polar
71
+ equaltorial latitudes and an interrupted Colignon projection for polar
72
72
latitudes.
73
73
**/
74
74
@@ -77,7 +77,7 @@ double rot[7][2][2] = ROT;
77
77
* @param v the parameter whose sign is returned.
78
78
* @return 1 for positive number, -1 for negative, and 0 for zero.
79
79
**/
80
- double sign (double v ) {
80
+ static double pj_sign (double v ) {
81
81
return v > 0 ? 1 : (v < 0 ? -1 : 0 );
82
82
}
83
83
/**
@@ -286,7 +286,7 @@ double auth_lat(double phi, double e, int inverse){
286
286
double ratio = q /qp ;
287
287
// Rounding errors
288
288
if ( fabsl (ratio ) > 1 ){
289
- ratio = sign (ratio );
289
+ ratio = pj_sign (ratio );
290
290
}
291
291
return asin (ratio );
292
292
}
@@ -316,7 +316,7 @@ XY healpix_sphere(LP lp, PJ *P){
316
316
}
317
317
lamc = -3 * PI /4 + (PI /2 )* cn ;
318
318
xy .x = lamc + (lam - lamc ) * sigma ;
319
- xy .y = sign (phi )* PI /4 * (2 - sigma );
319
+ xy .y = pj_sign (phi )* PI /4 * (2 - sigma );
320
320
}
321
321
xy .x = scale_number (xy .x ,P -> a ,0 );
322
322
xy .y = scale_number (xy .y ,P -> a ,0 );
@@ -348,10 +348,10 @@ LP healpix_sphere_inv(XY xy, PJ *P){
348
348
xc = -3.0 * PI /4.0 + (PI /2.0 )* cn ;
349
349
tau = 2.0 - 4.0 * fabsl (y )/PI ;
350
350
lp .lam = xc + (x - xc )/tau ;
351
- lp .phi = sign (y )* asin (1.0 - pow (tau , 2.0 )/3.0 );
351
+ lp .phi = pj_sign (y )* asin (1.0 - pow (tau , 2.0 )/3.0 );
352
352
} else {
353
353
lp .lam = -1.0 * PI - P -> lam0 ;
354
- lp .phi = sign (y )* PI /2.0 ;
354
+ lp .phi = pj_sign (y )* PI /2.0 ;
355
355
}
356
356
return (lp );
357
357
}
0 commit comments