Changeset 3351
- Timestamp:
- Mar 1, 2005, 11:38:23 AM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 edited
-
astro/psCoord.c (modified) (6 diffs)
-
astronomy/psCoord.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r3334 r3351 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 2-25 22:28:42$12 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-03-01 21:38:23 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 264 264 XXX: Private Function. 265 265 266 piNormalize(): take an input angle in radians and convert it to the range 0: PI.266 piNormalize(): take an input angle in radians and convert it to the range 0:2*PI. 267 267 *****************************************************************************/ 268 268 psF32 piNormalize(psF32 angle) 269 269 { 270 270 while (angle < FLT_EPSILON) { 271 angle+=PS_PI ;272 } 273 274 while (angle >= PS_PI) {275 angle-=PS_PI ;271 angle+=PS_PI*2; 272 } 273 274 while (angle >= (PS_PI*2)) { 275 angle-=PS_PI*2; 276 276 } 277 277 return(angle); … … 299 299 psF64 eq55 = (sin(delta) * transform->cosDeltaP) - 300 300 (cos(delta) * transform->sinDeltaP * sin(alphaMinusAlphaP)); 301 302 301 psF64 eq56 = (cos(delta) * transform->cosDeltaP * sin(alphaMinusAlphaP)) + 303 302 (sin(delta) * transform->sinDeltaP); 304 305 303 psF64 eq57 = cos(delta) * cos(alphaMinusAlphaP); 306 304 307 305 psF64 theta = asin(eq55); 308 psF64 phi = atan2(eq56, eq57) + transform->alphaP; 309 310 306 psF64 phi = atan2(eq56, eq57) + transform->phiP; 311 307 out->r = piNormalize(phi); 312 308 out->d = theta; … … 344 340 345 341 // Don't neglect the minus sign on deltaP (bug 244): 346 return (psSphereTransformAlloc(alphaP, -deltaP, phiP));342 return (psSphereTransformAlloc(alphaP, deltaP, phiP)); 347 343 } 348 344 … … 376 372 psF64 phiP = 0.0; 377 373 378 return (psSphereTransformAlloc(alphaP, deltaP, phiP));374 return (psSphereTransformAlloc(alphaP, -deltaP, phiP)); 379 375 } 380 376 381 377 // XXX: This is bug 245: alphaP swaps with phiP from psSphereTransformGalacticToICRS() 382 psSphereTransform* psSphereTransform ICRSToGalactic(void)378 psSphereTransform* psSphereTransformGalacticToICRS(void) 383 379 { 384 380 psF64 alphaP = DEG_TO_RAD(32.93192); … … 389 385 } 390 386 391 psSphereTransform* psSphereTransform GalacticToICRS(void)387 psSphereTransform* psSphereTransformICRSToGalactic(void) 392 388 { 393 389 psF64 alphaP = DEG_TO_RAD(282.85948); -
trunk/psLib/src/astronomy/psCoord.c
r3334 r3351 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 2-25 22:28:42$12 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-03-01 21:38:23 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 264 264 XXX: Private Function. 265 265 266 piNormalize(): take an input angle in radians and convert it to the range 0: PI.266 piNormalize(): take an input angle in radians and convert it to the range 0:2*PI. 267 267 *****************************************************************************/ 268 268 psF32 piNormalize(psF32 angle) 269 269 { 270 270 while (angle < FLT_EPSILON) { 271 angle+=PS_PI ;272 } 273 274 while (angle >= PS_PI) {275 angle-=PS_PI ;271 angle+=PS_PI*2; 272 } 273 274 while (angle >= (PS_PI*2)) { 275 angle-=PS_PI*2; 276 276 } 277 277 return(angle); … … 299 299 psF64 eq55 = (sin(delta) * transform->cosDeltaP) - 300 300 (cos(delta) * transform->sinDeltaP * sin(alphaMinusAlphaP)); 301 302 301 psF64 eq56 = (cos(delta) * transform->cosDeltaP * sin(alphaMinusAlphaP)) + 303 302 (sin(delta) * transform->sinDeltaP); 304 305 303 psF64 eq57 = cos(delta) * cos(alphaMinusAlphaP); 306 304 307 305 psF64 theta = asin(eq55); 308 psF64 phi = atan2(eq56, eq57) + transform->alphaP; 309 310 306 psF64 phi = atan2(eq56, eq57) + transform->phiP; 311 307 out->r = piNormalize(phi); 312 308 out->d = theta; … … 344 340 345 341 // Don't neglect the minus sign on deltaP (bug 244): 346 return (psSphereTransformAlloc(alphaP, -deltaP, phiP));342 return (psSphereTransformAlloc(alphaP, deltaP, phiP)); 347 343 } 348 344 … … 376 372 psF64 phiP = 0.0; 377 373 378 return (psSphereTransformAlloc(alphaP, deltaP, phiP));374 return (psSphereTransformAlloc(alphaP, -deltaP, phiP)); 379 375 } 380 376 381 377 // XXX: This is bug 245: alphaP swaps with phiP from psSphereTransformGalacticToICRS() 382 psSphereTransform* psSphereTransform ICRSToGalactic(void)378 psSphereTransform* psSphereTransformGalacticToICRS(void) 383 379 { 384 380 psF64 alphaP = DEG_TO_RAD(32.93192); … … 389 385 } 390 386 391 psSphereTransform* psSphereTransform GalacticToICRS(void)387 psSphereTransform* psSphereTransformICRSToGalactic(void) 392 388 { 393 389 psF64 alphaP = DEG_TO_RAD(282.85948);
Note:
See TracChangeset
for help on using the changeset viewer.
