Changeset 1440 for trunk/psLib/src/astro
- Timestamp:
- Aug 9, 2004, 1:34:58 PM (22 years ago)
- Location:
- trunk/psLib/src/astro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r1407 r1440 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 7 00:06:06$13 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-09 23:34:57 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 33 33 // This is the only function in this file which I understand. 34 psPlane *psPlaneTransformApply(psPlane * out, const psPlaneTransform * transform, const psPlane* coords)34 psPlane* psPlaneTransformApply(psPlane* out, const psPlaneTransform* transform, const psPlane* coords) 35 35 { 36 36 if (out == NULL) { 37 out = (psPlane *) psAlloc(sizeof(psPlane));37 out = (psPlane* ) psAlloc(sizeof(psPlane)); 38 38 } 39 39 out->x = transform->x->coeff[0][0] + … … 48 48 // This transformation takes into account parameters beyond an objects 49 49 // spatial coordinates: term3 and term4. 50 psPlane *psPlaneDistortApply(psPlane* out,51 const psPlaneDistort * transform,52 const psPlane * coords, float term3, float term4)50 psPlane* psPlaneDistortApply(psPlane* out, 51 const psPlaneDistort* transform, 52 const psPlane* coords, float term3, float term4) 53 53 { 54 54 if (out == NULL) { 55 out = (psPlane *) psAlloc(sizeof(psPlane));55 out = (psPlane* ) psAlloc(sizeof(psPlane)); 56 56 } 57 57 … … 70 70 71 71 // This function prototype has been modified since the SDRS. 72 psSphereTransform *psSphereTransformAlloc(double NPlat, double Xo, double xo)73 { 74 psSphereTransform *tmp = (psSphereTransform *) psAlloc(sizeof(psSphereTransform));72 psSphereTransform* psSphereTransformAlloc(double NPlat, double Xo, double xo) 73 { 74 psSphereTransform* tmp = (psSphereTransform* ) psAlloc(sizeof(psSphereTransform)); 75 75 76 76 tmp->sinPhi = sin(NPlat); … … 89 89 // there are no typo's. 90 90 91 psSphere *psSphereTransformApply(psSphere * out, const psSphereTransform * transform, const psSphere* coord)91 psSphere* psSphereTransformApply(psSphere* out, const psSphereTransform* transform, const psSphere* coord) 92 92 { 93 93 double sinY = 0.0; … … 100 100 101 101 if (out == NULL) { 102 out = (psSphere *) psAlloc(sizeof(psSphere));102 out = (psSphere* ) psAlloc(sizeof(psSphere)); 103 103 } 104 104 … … 117 117 } 118 118 119 psSphereTransform *psSphereTransformICRStoEcliptic(psTime time)119 psSphereTransform* psSphereTransformICRStoEcliptic(psTime time) 120 120 { 121 121 struct tm *tmTime = psTimeToTM(time); … … 129 129 } 130 130 131 psSphereTransform *psSphereTransformEcliptictoICRS(psTime time)131 psSphereTransform* psSphereTransformEcliptictoICRS(psTime time) 132 132 { 133 133 struct tm *tmTime = psTimeToTM(time); … … 141 141 } 142 142 143 psSphereTransform *psSphereTransformICRStoGalatic(void)143 psSphereTransform* psSphereTransformICRStoGalatic(void) 144 144 { 145 145 return (psSphereTransformAlloc(62.6, 282.25, 33.0)); 146 146 } 147 147 148 psSphereTransform *psSphereTransformGalatictoICRS(void)148 psSphereTransform* psSphereTransformGalatictoICRS(void) 149 149 { 150 150 return (psSphereTransformAlloc(-62.6, 33.0, 282.25)); … … 178 178 // XXX: Waiting for the definition of the PS_PROJ_PAR projection. 179 179 // XXX: Waiting for the definition of the PS_PROJ_GLS projection. 180 psPlane *psProject(const psSphere * coord, const psProjection* projection)180 psPlane* psProject(const psSphere* coord, const psProjection* projection) 181 181 { 182 182 float R = 0.0; 183 183 float alpha = 0.0; 184 psPlane *tmp = (psPlane *) psAlloc(sizeof(psPlane));184 psPlane* tmp = (psPlane* ) psAlloc(sizeof(psPlane)); 185 185 186 186 if (projection->type == PS_PROJ_TAN) { … … 220 220 // XXX: Waiting for the definition of the PS_PROJ_PAR projection. 221 221 // XXX: Waiting for the definition of the PS_PROJ_GLS projection. 222 psSphere *psDeproject(const psPlane * coord, const psProjection* projection)222 psSphere* psDeproject(const psPlane* coord, const psProjection* projection) 223 223 { 224 224 float R = 0.0; … … 226 226 float chu1 = 0.0; 227 227 float chu2 = 0.0; 228 psSphere *tmp = (psSphere *) psAlloc(sizeof(psSphere));228 psSphere* tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 229 229 230 230 if (projection->type == PS_PROJ_TAN) { … … 267 267 // XXX: Do I need to check for unacceptable transformation parameters? 268 268 // Maybe, if the points are on the North/South Pole, etc? 269 psSphere *psSphereGetOffset(const psSphere* restrict position1,270 const psSphere * restrict position2,269 psSphere* psSphereGetOffset(const psSphere* restrict position1, 270 const psSphere* restrict position2, 271 271 psSphereOffsetMode mode, psSphereOffsetUnit unit) 272 272 { 273 // psPlane *lin;273 // psPlane* lin; 274 274 psProjection proj; 275 psSphere *tmp;275 psSphere* tmp; 276 276 double tmpR = 0.0; 277 277 double tmpD = 0.0; … … 313 313 } 314 314 315 tmp = (psSphere *) psAlloc(sizeof(psSphere));315 tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 316 316 tmp->r = tmpR; 317 317 tmp->d = tmpD; … … 328 328 // Maybe, if the points are on the North/South Pole, etc? 329 329 // XXX: I copied the algorithm from the ADD exactly. 330 psSphere *psSphereSetOffset(const psSphere* restrict position,331 const psSphere * restrict offset,330 psSphere* psSphereSetOffset(const psSphere* restrict position, 331 const psSphere* restrict offset, 332 332 psSphereOffsetMode mode, psSphereOffsetUnit unit) 333 333 { 334 334 psPlane lin; 335 psSphere *tmp;335 psSphere* tmp; 336 336 psProjection proj; 337 337 double tmpR = 0.0; … … 368 368 } 369 369 370 tmp = (psSphere *) psAlloc(sizeof(psSphere));370 tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 371 371 tmp->r = position->r + tmpR; 372 372 tmp->r = position->d + tmpD; -
trunk/psLib/src/astro/psCoord.h
r1426 r1440 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-09 2 2:44:25$13 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-09 23:34:57 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 typedef struct 73 73 { 74 psDPolynomial2D *x; ///< 2D polynomial transform of X coordinates75 psDPolynomial2D *y; ///< 2D polynomial transform of Y coordinates74 psDPolynomial2D* x; ///< 2D polynomial transform of X coordinates 75 psDPolynomial2D* y; ///< 2D polynomial transform of Y coordinates 76 76 } 77 77 psPlaneTransform; … … 91 91 typedef struct 92 92 { 93 psDPolynomial4D *x; ///< 4D polynomial transform of X coordinates94 psDPolynomial4D *y; ///< 4D polynomial transform of Y coordinates93 psDPolynomial4D* x; ///< 4D polynomial transform of X coordinates 94 psDPolynomial4D* y; ///< 4D polynomial transform of Y coordinates 95 95 } 96 96 psPlaneDistort; … … 171 171 * 172 172 */ 173 psPlane *psPlaneTransformApply(psPlane* out, ///< a psPlane to recycle. If NULL, a new one is generated.174 const psPlaneTransform * transform, ///< the transform to apply175 const psPlane * coords ///< the coordinate to apply the transform above.173 psPlane* psPlaneTransformApply(psPlane* out, ///< a psPlane to recycle. If NULL, a new one is generated. 174 const psPlaneTransform* transform, ///< the transform to apply 175 const psPlane* coords ///< the coordinate to apply the transform above. 176 176 ); 177 177 … … 179 179 * 180 180 */ 181 psPlane *psPlaneDistortApply(psPlane* out, ///< a psPlane to recycle. If NULL, a new one is generated.182 const psPlaneDistort * transform, ///< the transform to apply183 const psPlane * coords, ///< the coordinate to apply the transform above.181 psPlane* psPlaneDistortApply(psPlane* out, ///< a psPlane to recycle. If NULL, a new one is generated. 182 const psPlaneDistort* transform, ///< the transform to apply 183 const psPlane* coords, ///< the coordinate to apply the transform above. 184 184 float term3, ///< third term -- maybe magnitude 185 185 float term4 ///< forth term -- maybe color … … 189 189 * 190 190 */ 191 psSphereTransform *psSphereTransformAlloc(double NPlat, ///< north pole latitude191 psSphereTransform* psSphereTransformAlloc(double NPlat, ///< north pole latitude 192 192 double Xo, ///< First PT of Ares lon 193 193 double xo ///< First PT of Ares equiv lon … … 197 197 * 198 198 */ 199 psSphere *psSphereTransformApply(psSphere* out, ///< a psSphere to recycle. If NULL, a new one is199 psSphere* psSphereTransformApply(psSphere* out, ///< a psSphere to recycle. If NULL, a new one is 200 200 // generated. 201 const psSphereTransform * transform, ///< the transform to apply202 const psSphere * coord ///< the coordinate to apply the transform above.x201 const psSphereTransform* transform, ///< the transform to apply 202 const psSphere* coord ///< the coordinate to apply the transform above.x 203 203 ); 204 204 205 psSphereTransform *psSphereTransformICRStoEcliptic(psTime time);206 207 psSphereTransform *psSphereTransformEcliptictoICRS(psTime time);208 209 psSphereTransform *psSphereTransformICRStoGalatic(void);210 211 psSphereTransform *psSphereTransformGalatictoICRS(void);212 213 psPlane *psProject(const psSphere * coord, const psProjection* projection);214 215 psSphere *psDeproject(const psPlane * coord, const psProjection* projection);216 217 psSphere *psSphereGetOffset(const psSphere* restrict position1,218 const psSphere * restrict position2,205 psSphereTransform* psSphereTransformICRStoEcliptic(psTime time); 206 207 psSphereTransform* psSphereTransformEcliptictoICRS(psTime time); 208 209 psSphereTransform* psSphereTransformICRStoGalatic(void); 210 211 psSphereTransform* psSphereTransformGalatictoICRS(void); 212 213 psPlane* psProject(const psSphere* coord, const psProjection* projection); 214 215 psSphere* psDeproject(const psPlane* coord, const psProjection* projection); 216 217 psSphere* psSphereGetOffset(const psSphere* restrict position1, 218 const psSphere* restrict position2, 219 219 psSphereOffsetMode mode, psSphereOffsetUnit unit); 220 220 221 psSphere *psSphereSetOffset(const psSphere* restrict position,222 const psSphere * restrict offset,221 psSphere* psSphereSetOffset(const psSphere* restrict position, 222 const psSphere* restrict offset, 223 223 psSphereOffsetMode mode, psSphereOffsetUnit unit); 224 224
Note:
See TracChangeset
for help on using the changeset viewer.
