Changeset 5749 for trunk/psLib/test/astro
- Timestamp:
- Dec 7, 2005, 4:49:04 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tst_psEarthOrientation.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tst_psEarthOrientation.c
r5716 r5749 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-12-0 7 02:13:40$7 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-12-08 02:49:04 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 66 66 { 67 67 if (obj == NULL) { 68 obj = psSphereAlloc(); 69 obj->r = objR; 70 obj->d = objD; 68 // obj = psSphereAlloc(); 69 // obj->r = objR; 70 // obj->d = objD; 71 psCube *tempCube = psCubeAlloc(); 72 tempCube->x = -0.3598480726985338; 73 tempCube->y = 0.5555012823608123; 74 tempCube->z = 0.7496183628158023; 75 obj = psCubeToSphere(tempCube); 76 psFree(tempCube); 71 77 } 72 78 } … … 544 550 return 2; 545 551 } 546 printf("\nOutput sphere rotation = %.13g, %.13g, %.13g, %.13g\n\n",547 teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3);548 552 549 553 objSetup(); 550 554 psSphereRot *earthRot = psSphereRotConjugate(NULL, teoceo); 551 555 psSphere *result = psSphereRotApply(NULL, earthRot, obj); 552 // psCube *cube = psSphereToCube(obj);553 556 psCube *cube = psSphereToCube(result); 554 555 557 556 558 double x, y, z; … … 558 560 y = -0.6616523084626379; 559 561 z = 0.7496183628158023; 560 if ( fabs(x-cube->x) > DBL_EPSILON || fabs(y-cube->y) > DBL_EPSILON ||561 fabs(z-cube->z) > DBL_EPSILON) {562 if ( fabs(x-cube->x) > FLT_EPSILON || fabs(y-cube->y) > FLT_EPSILON || 563 fabs(z-cube->z) > FLT_EPSILON) { 562 564 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 563 565 "psSphereRot_TEOtoCEO returned incorrect values.\n"); … … 570 572 } 571 573 // psFree(now); 574 psFree(rot); 575 psFree(empty); 572 576 psFree(result); 573 577 psFree(obj); … … 615 619 } 616 620 621 // psCube *tempCube = psCubeAlloc(); 622 // tempCube->x = -0.35963388069046304; 623 // tempCube->y = 0.5555192509816625; 624 // tempCube->z = 0.749078321908413; 625 // obj = psCubeToSphere(tempCube); 626 // psFree(tempCube); 627 obj = psSphereAlloc(); 628 obj->r = objR; 629 obj->d = objD; 630 psSphereRot *precessionNutation = psSphereRotConjugate(NULL, rot); 631 psSphere *result = psSphereRotApply(NULL, precessionNutation, obj); 632 psCube *cube = psSphereToCube(result); 633 double x, y, z; 634 x = -0.3598480726985338; 635 y = 0.5555012823608123; 636 z = 0.7496183628158023; 637 printf("\nOutput cube = x,y,z = %.13g, %.13g, %.13g\n", cube->x, cube->y, cube->z); 638 printf("Expected cube = x,y,z = %.13g, %.13g, %.13g\n", x, y, z); 639 printf("A difference of: %.13g, %.13g, %.13g\n\n", 640 (x-cube->x), (y-cube->y), (z-cube->z)); 641 psFree(obj); 642 643 617 644 if (fabs(rot->q0-q0) > DBL_EPSILON || fabs(rot->q1-q1) > DBL_EPSILON || 618 645 fabs(rot->q2-q2) > DBL_EPSILON || fabs(rot->q3-q3) > DBL_EPSILON) { … … 635 662 printf("\n Sphere -test- has values r,d = %.8g, %.8g \n", test->r, test->d); 636 663 664 psFree(precessionNutation); 665 psFree(result); 666 psFree(cube); 667 637 668 psFree(test); 638 669 psFree(rot);
Note:
See TracChangeset
for help on using the changeset viewer.
