Changeset 5306 for trunk/psLib/test/astro
- Timestamp:
- Oct 13, 2005, 10:23:57 AM (21 years ago)
- Location:
- trunk/psLib/test/astro
- Files:
-
- 3 edited
-
tst_psEarthOrientation.c (modified) (2 diffs)
-
tst_psSphereOps.c (modified) (3 diffs)
-
verified/tst_psSphereOps.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tst_psEarthOrientation.c
r5235 r5306 1 /** @file tst_ps Coord.c1 /** @file tst_psEarthOrientation.c 2 2 * 3 3 * @brief The code will go on ... … … 6 6 * @author d-Rob, MHPCC 7 7 * 8 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-10- 07 21:27:50$8 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-10-13 20:23:57 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/astro/tst_psSphereOps.c
r5254 r5306 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-10- 08 03:51:20$8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-10-13 20:23:57 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 48 48 #define ERROR_TOL 0.0001 49 49 50 #define ALPHA_P 0.5 * M_PI51 #define DELTA_P 1.0 * M_PI52 #define PHI_P 1.5 * M_PI50 #define ALPHA_P M_PI/6 51 #define DELTA_P M_PI/4 52 #define PHI_P M_PI/2 53 53 54 54 psS32 testSphereRotAlloc( void ) … … 62 62 return 1; 63 63 } 64 // Verify sin member is updated 65 double vx = cos(DELTA_P)*cos(ALPHA_P); 66 double vy = cos(DELTA_P)*sin(ALPHA_P); 67 double vz = sin(DELTA_P); 68 double q0 = vx * sin(PHI_P/2.0); 69 double q1 = vy * sin(PHI_P/2.0); 70 double q2 = vz * sin(PHI_P/2.0); 71 double q3 = cos(PHI_P/2.0); 72 double len = sqrt(q0*q0 + q1*q1 + q2*q2 + q3*q3); 73 printf("\nvz = %lf\n", vz); 74 q0 = q0/len; 75 q1 = q1/len; 76 q2 = q2/len; 77 q3 = q3/len; 78 64 65 double a0 = (ALPHA_P - PHI_P)/2.0; 66 double a1 = (ALPHA_P - PHI_P)/2.0; 67 double a2 = (ALPHA_P + PHI_P)/2.0; 68 double a3 = (ALPHA_P + PHI_P)/2.0; 69 70 double q3 = cos(a3)*cos(DELTA_P/2); 71 double q0 = sin(a0)*sin(DELTA_P/2); 72 double q1 = cos(a1)*sin(DELTA_P/2); 73 double q2 = sin(a2)*cos(DELTA_P/2); 74 75 printf("\n q0=%lf, q1=%lf, q2=%lf, q3=%lf,\n", q0, q1, q2, q3); 76 printf("myq0=%lf, myq1=%lf, myq2=%lf, myq3=%lf\n", myST->q0, myST->q1, myST->q2, myST->q3); 79 77 if (FLT_EPSILON < fabs(q0 - myST->q0)) { 80 psError(PS_ERR_UNKNOWN,true,"myST->q0 is % f, should be %f\n", myST->q0, q0);78 psError(PS_ERR_UNKNOWN,true,"myST->q0 is %lf, should be %lf\n", myST->q0, q0); 81 79 return 2; 82 80 } -
trunk/psLib/test/astro/verified/tst_psSphereOps.stdout
r5235 r5306 1 2 q0=-0.191342, q1=0.331414, q2=0.800103, q3=0.461940, 3 myq0=-0.191342, myq1=0.331414, myq2=0.800103, myq3=0.461940
Note:
See TracChangeset
for help on using the changeset viewer.
