Changeset 5319 for trunk/psLib/src/astro
- Timestamp:
- Oct 13, 2005, 2:07:37 PM (21 years ago)
- Location:
- trunk/psLib/src/astro
- Files:
-
- 2 edited
-
psSphereOps.c (modified) (5 diffs)
-
psSphereOps.h (modified) (2 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 -
trunk/psLib/src/astro/psSphereOps.h
r5306 r5319 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-10-1 3 20:23:57 $9 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-10-14 00:07:37 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 73 73 ); 74 74 75 psSphereRot* psSphereRotAlloc2(76 double alphaP, ///< north pole latitude77 double deltaP, ///< north pole longitude78 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).79 );80 81 psSphereRot* psSphereRotAlloc3(82 double alphaP, ///< north pole latitude83 double deltaP, ///< north pole longitude84 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).85 );86 87 psSphereRot* psSphereRotAlloc4(88 double alphaP, ///< north pole latitude89 double deltaP, ///< north pole longitude90 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).91 );92 93 psSphereRot* psSphereRotAlloc5(94 double alphaP, ///< north pole latitude95 double deltaP, ///< north pole longitude96 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).97 );98 99 psSphereRot* psSphereRotAlloc6(100 double alphaP, ///< north pole latitude101 double deltaP, ///< north pole longitude102 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).103 );104 105 psSphereRot* psSphereRotAlloc7(106 double alphaP, ///< north pole latitude107 double deltaP, ///< north pole longitude108 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).109 );110 111 psSphereRot* psSphereRotAlloc8(112 double alphaP, ///< north pole latitude113 double deltaP, ///< north pole longitude114 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).115 );116 117 118 75 /** Checks the type of a particular pointer. 119 76 *
Note:
See TracChangeset
for help on using the changeset viewer.
