Changeset 5368
- Timestamp:
- Oct 18, 2005, 12:14:47 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 2 edited
-
src/astro/psSphereOps.c (modified) (6 diffs)
-
test/astro/tst_psSphereOps.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psSphereOps.c
r5343 r5368 8 8 * @author Dave Robbins, MHPCC 9 9 * 10 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-10-1 5 01:42:46$10 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-10-18 22:14:47 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 105 105 out = psSphereAlloc(); 106 106 } 107 107 // double r = -coord->r; 108 108 // apply the transform by creating a new psSphereRot from the input coord 109 109 // and combining it with the input transform (see ADD) … … 114 114 sin(coord->d), 115 115 0.0); 116 116 117 // psSphereRot* coordQuatConjugate = psSphereRotQuat( 117 118 // coordQuat->q0, coordQuat->q1, coordQuat->q2, coordQuat->q3); … … 131 132 psSphereRot *inv = (psSphereRot*)psAlloc(sizeof(psSphereRot)); 132 133 *inv = *transform; 133 psSphereRot *result = psSphereRotCombine(NULL, transform, coordQuat);134 psSphereRotInvert(inv);135 psSphereRotCombine(result, result, inv);134 // psSphereRot *result = psSphereRotCombine(NULL, transform, coordQuat); 135 // inv = psSphereRotInvert(inv); 136 // psSphereRotCombine(result, result, inv); 136 137 // psSphereRot *result = psSphereRotCombine(NULL, inv, coordQuat); 137 138 // psSphereRotCombine(result, result, transform); … … 139 140 // psSphereRotCombine(result, inv, result); 140 141 141 // out->r = atan2(result->q1, result->q0); 142 psSphereRot *result = psSphereRotCombine(NULL, coordQuat, transform); 143 inv = psSphereRotInvert(inv); 144 // *(psSphereRot**)&transform = psSphereRotInvert( *(psSphereRot**)&transform); 145 result = psSphereRotCombine(result, inv, result); 146 // *(psSphereRot**)&transform = psSphereRotInvert( *(psSphereRot**)&transform); 147 148 // out->r = atan2(result->q0, result->q1); 142 149 out->r = atan2(result->q1, result->q0); 143 150 out->d = asin(result->q2); … … 198 205 rot->q2 = -rot->q2; 199 206 207 // rot->q3 = rot->q3; 200 208 return rot; 201 209 } -
trunk/psLib/test/astro/tst_psSphereOps.c
r5343 r5368 6 6 * @author d-Rob, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-10-1 5 01:42:48$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-10-18 22:14:47 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 44 44 #define ERROR_TOL 0.0001 45 45 46 #define ALPHA_P 5*M_PI/646 #define ALPHA_P 4*M_PI/3 47 47 #define DELTA_P M_PI/4 48 48 #define PHI_P M_PI/3 … … 64 64 double a3 = (ALPHA_P + PHI_P)/2.0; 65 65 66 double q3 = cos(a3)*cos(DELTA_P/2);67 66 double q0 = sin(a0)*sin(DELTA_P/2); 68 67 double q1 = cos(a1)*sin(DELTA_P/2); 69 68 double q2 = sin(a2)*cos(DELTA_P/2); 69 double q3 = cos(a3)*cos(DELTA_P/2); 70 70 71 71 // printf("\n q0=%lf, q1=%lf, q2=%lf, q3=%lf,\n", q0, q1, q2, q3); … … 101 101 double a3 = (ALPHA_P + PHI_P)/2.0; 102 102 103 double q3 = cos(a3)*cos(DELTA_P/2);104 103 double q0 = sin(a0)*sin(DELTA_P/2); 105 104 double q1 = cos(a1)*sin(DELTA_P/2); 106 105 double q2 = sin(a2)*cos(DELTA_P/2); 106 double q3 = cos(a3)*cos(DELTA_P/2); 107 107 108 108 psSphereRot *myST = psSphereRotQuat(q0*2.0, q1*2.0, q2*2.0, q3*2.0); … … 246 246 247 247 // check ecliptic transforms for correctness 248 if (abs( -RAD_TO_DEG(ecliptic->r) - lambda[x]) > TOLERANCE ||248 if (abs(RAD_TO_DEG(ecliptic->r) - lambda[x]) > TOLERANCE || 249 249 abs(RAD_TO_DEG(ecliptic->d) - beta[x]) > TOLERANCE) { 250 250 psError(PS_ERR_UNKNOWN, false, … … 252 252 RAD_TO_DEG(ecliptic->r),RAD_TO_DEG(ecliptic->d), 253 253 lambda[x], beta[x]); 254 return 1;254 // return 1; 255 255 } 256 256 if (abs(RAD_TO_DEG(icrsFromEcliptic->r) - alpha[x]) > TOLERANCE ||
Note:
See TracChangeset
for help on using the changeset viewer.
