Changeset 12752 for trunk/Ohana
- Timestamp:
- Apr 5, 2007, 1:35:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libdvo/src/coordops.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/src/coordops.c
r12724 r12752 200 200 sphi = cdel*salp; /* = cos(theta)*sin(phi) */ 201 201 cphi = cdel*sdp*calp - sdel*cdp; /* = cos(theta)*cos(phi) */ 202 if (stht < 0) return (FALSE);203 202 204 203 switch (proj) { 205 204 case PROJ_TAN: 206 205 case PROJ_DIS: 207 *L = DEG_RAD * sphi / stht; 208 *M = -DEG_RAD * cphi / stht; 209 return (TRUE); 206 Rc = hypot(sphi, cphi); 207 *L = (stht == 0) ? 180.0 * sphi / Rc : +DEG_RAD * sphi / stht; 208 *M = (stht == 0) ? 180.0 * cphi / Rc : -DEG_RAD * cphi / stht; 209 return (stht > 0); 210 210 case PROJ_SIN: 211 *L = DEG_RAD * sphi;211 *L = +DEG_RAD * sphi; 212 212 *M = -DEG_RAD * cphi; 213 return ( TRUE);213 return (stht > 0); 214 214 case PROJ_ZEA: 215 215 case PROJ_ZPL: … … 217 217 *L = Rc * sphi; 218 218 *M = -Rc * cphi; 219 return ( TRUE);219 return (stht > 0); 220 220 default: 221 221 return (FALSE); … … 320 320 321 321 status = RD_to_LM (&L, &M, ra, dec, coords); 322 if (!status) return FALSE; 323 324 status = LM_to_XY (x, y, L, M, coords); 322 323 if (finite(L) && finite(M)) { 324 LM_to_XY (x, y, L, M, coords); 325 } else { 326 *x = L; 327 *y = M; 328 } 325 329 return (status); 326 330 }
Note:
See TracChangeset
for help on using the changeset viewer.
