Changeset 6039 for trunk/psLib/src/astro/psSphereOps.c
- Timestamp:
- Jan 18, 2006, 1:49:06 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psSphereOps.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psSphereOps.c
r5493 r6039 8 8 * @author Dave Robbins, MHPCC 9 9 * 10 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $11 * @date $Date: 200 5-11-10 00:13:50$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-01-18 23:49:06 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 536 536 } 537 537 538 /****************************************************************************** 539 psSpherePrecess(coords, fromTime, toTime): 540 541 XXX: Use static memory for tmpST. 542 *****************************************************************************/ 543 psSphere *psSpherePrecess(psSphere *coords, 544 const psTime *fromTime, 545 const psTime *toTime) 546 { 547 // Check input for NULL pointers 548 PS_ASSERT_PTR_NON_NULL(coords, NULL); 549 PS_ASSERT_PTR_NON_NULL(fromTime, NULL); 550 PS_ASSERT_PTR_NON_NULL(toTime, NULL); 551 552 // Calculate Julian centuries 553 psF64 fromMJD = psTimeToMJD(fromTime); 554 psF64 toMJD = psTimeToMJD(toTime); 555 psF64 T = (toMJD - fromMJD) / JULIAN_CENTURY; 556 557 // Calculate conversion constants 558 // psF64 alphaP = DEG_TO_RAD(90.0) - ((DEG_TO_RAD(0.6406161) * T) + 559 psF64 alphaP = DEG_TO_RAD(180.0) + ((DEG_TO_RAD(0.6406161) * T) + 560 (DEG_TO_RAD(0.0000839) * T * T) + 561 (DEG_TO_RAD(0.000005) * T * T * T)); 562 563 psF64 deltaP = (DEG_TO_RAD(0.5567530) * T) - 564 (DEG_TO_RAD(0.0001185) * T * T) - 565 (DEG_TO_RAD(0.0000116) * T * T * T); 566 567 // psF64 phiP = DEG_TO_RAD(90.0) + ((DEG_TO_RAD(0.6406161) * T) + 568 psF64 phiP = DEG_TO_RAD(180.0) + ((DEG_TO_RAD(0.6406161) * T) + 569 (DEG_TO_RAD(0.0003041) * T * T) + 570 (DEG_TO_RAD(0.0000051) * T * T * T)); 571 572 // Create transform with proper constants 573 psSphereRot* tmpST = psSphereRotAlloc(alphaP, deltaP, phiP); 574 575 // Apply transform to coordinates 576 psSphere *out = psSphereRotApply(NULL, tmpST, coords); 577 if (out->r < -0.0001) { 578 out->r += 2.0 * M_PI; 579 } 580 581 psFree(tmpST); 582 583 return(out); 584 } 585 538
Note:
See TracChangeset
for help on using the changeset viewer.
