Changeset 5319 for trunk/psLib/src/astro/psSphereOps.c
- Timestamp:
- Oct 13, 2005, 2:07:37 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psSphereOps.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psSphereOps.c
r5306 r5319 6 6 * 7 7 * @author Robert DeSonia, MHPCC 8 * @author Dave Robbins, MHPCC 8 9 * 9 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-10-1 3 20:23:57 $10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-10-14 00:07:37 $ 11 12 * 12 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 62 63 // calculate t*s*r. 63 64 psSphereRot* result = psSphereRotCombine(NULL,&t,&s); 64 psMemSetDeallocator(result, (psFreeFunc)sphereRotFree);65 65 psSphereRotCombine(result,result,&r); 66 66 … … 79 79 double q3) 80 80 { 81 psSphereRot* rot = psAlloc(sizeof(psSphereRot)); 81 psSphereRot* rot = (psSphereRot*)psAlloc(sizeof(psSphereRot)); 82 psMemSetDeallocator(rot, (psFreeFunc)sphereRotFree); 82 83 83 84 double len = sqrt(q0*q0 + q1*q1 + q2*q2 + q3*q3); … … 113 114 sin(coord->d), 114 115 0.0); 115 psSphereRot* coordQuatConjugate = psSphereRotQuat(116 coordQuat->q0, coordQuat->q1, coordQuat->q2, coordQuat->q3);117 coordQuat = psSphereRotInvert(coordQuat);116 // psSphereRot* coordQuatConjugate = psSphereRotQuat( 117 // coordQuat->q0, coordQuat->q1, coordQuat->q2, coordQuat->q3); 118 // coordQuat = psSphereRotInvert(coordQuat); 118 119 119 120 // calculate q=(rp)r' 120 coordQuat = psSphereRotCombine(coordQuat, transform, coordQuat);121 coordQuat = psSphereRotCombine(coordQuat, coordQuat, coordQuatConjugate);121 // coordQuat = psSphereRotCombine(coordQuat, transform, coordQuat); 122 // coordQuat = psSphereRotCombine(coordQuat, coordQuat, coordQuatConjugate); 122 123 // N.B., we can recycle coordQuat right away due to the implementation of 123 124 // psSphereRotCombine; it puts the input values in a local variable first 124 125 125 out->r = atan2(coordQuat->q1,coordQuat->q0); 126 out->d = asin(coordQuat->q2); 126 // out->r = atan2(coordQuat->q1,coordQuat->q0); 127 // out->d = asin(coordQuat->q2); 128 129 130 // psSphereRot *inv = psSphereRotInvert(transform); 131 psSphereRot *inv = (psSphereRot*)psAlloc(sizeof(psSphereRot)); 132 *inv = *transform; 133 psSphereRot *result = psSphereRotCombine(NULL, transform, coordQuat); 134 psSphereRotInvert(inv); 135 psSphereRotCombine(result, result, inv); 136 out->r = atan2(result->q1, result->q0); 137 out->d = asin(result->q2); 138 out->rErr = 0.0; 139 out->dErr = 0.0; 140 psFree(inv); 141 psFree(result); 127 142 128 143 psFree(coordQuat); 129 psFree(coordQuatConjugate);144 // psFree(coordQuatConjugate); 130 145 131 146 return out; … … 141 156 if (out == NULL) { 142 157 out = (psSphereRot* ) psAlloc(sizeof(psSphereRot)); 158 psMemSetDeallocator(out, (psFreeFunc)sphereRotFree); 143 159 } 144 160
Note:
See TracChangeset
for help on using the changeset viewer.
