Changeset 1440 for trunk/psLib/src/astro/psCoord.c
- Timestamp:
- Aug 9, 2004, 1:34:58 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psCoord.c (modified) (16 diffs)
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;
Note:
See TracChangeset
for help on using the changeset viewer.
