Changeset 2103
- Timestamp:
- Oct 13, 2004, 3:10:58 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 edited
-
astro/psCoord.c (modified) (11 diffs)
-
astronomy/psCoord.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r2083 r2103 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-1 3 21:06:07$12 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-14 01:10:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 const psPlane* coords) 97 97 { 98 PS_CHECK_NULL_PTR_RETURN_NULL(transform); 99 PS_CHECK_NULL_PTR_RETURN_NULL(coords); 98 100 if (out == NULL) { 99 101 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 114 116 float magnitude) 115 117 { 118 PS_CHECK_NULL_PTR_RETURN_NULL(transform); 119 PS_CHECK_NULL_PTR_RETURN_NULL(coords); 116 120 if (out == NULL) { 117 121 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 151 155 const psSphere* coord) 152 156 { 157 PS_CHECK_NULL_PTR_RETURN_NULL(transform); 158 PS_CHECK_NULL_PTR_RETURN_NULL(coord); 153 159 double sinY = 0.0; 154 160 double cosY = 0.0; … … 216 222 XXX: Waiting for the definition of the PS_PROJ_PAR projection. 217 223 XXX: Waiting for the definition of the PS_PROJ_GLS projection. 224 XXX: get rid of the psAborts 218 225 *****************************************************************************/ 219 226 psPlane* psProject(const psSphere* coord, 220 227 const psProjection* projection) 221 228 { 229 PS_CHECK_NULL_PTR_RETURN_NULL(coord); 230 PS_CHECK_NULL_PTR_RETURN_NULL(projection); 231 222 232 float R = 0.0; 223 233 float alpha = 0.0; … … 254 264 } else if (projection->type == PS_PROJ_GLS) { 255 265 psAbort(__func__, "The projection type PS_PROJ_GLS is undefined.\n"); 266 } else { 267 psAbort(__func__, "Unknown projection type.\n"); 256 268 } 257 269 … … 262 274 XXX: Waiting for the definition of the PS_PROJ_PAR projection. 263 275 XXX: Waiting for the definition of the PS_PROJ_GLS projection. 276 XXX: get rid of the psAborts 264 277 *****************************************************************************/ 265 278 psSphere* psDeproject(const psPlane* coord, 266 279 const psProjection* projection) 267 280 { 281 PS_CHECK_NULL_PTR_RETURN_NULL(coord); 282 PS_CHECK_NULL_PTR_RETURN_NULL(projection); 283 268 284 float R = 0.0; 269 285 float chu = 0.0; … … 304 320 } else if (projection->type == PS_PROJ_GLS) { 305 321 psAbort(__func__, "The projection type PS_PROJ_GLG is undefined.\n"); 322 } else { 323 psAbort(__func__, "Unknown projection type.\n"); 306 324 } 307 325 … … 329 347 psSphereOffsetUnit unit) 330 348 { 349 PS_CHECK_NULL_PTR_RETURN_NULL(position1); 350 PS_CHECK_NULL_PTR_RETURN_NULL(position2); 351 331 352 psPlane* lin; 332 353 psProjection proj; … … 351 372 tmp->d = position2->d - position1->d; 352 373 353 // XXX:Wrap these to an acceptable range. This assumes that all374 // Wrap these to an acceptable range. This assumes that all 354 375 // angles are in radians. 355 376 tmp->r = fmod(tmp->r, 2*M_PI); … … 394 415 psSphereOffsetUnit unit) 395 416 { 417 PS_CHECK_NULL_PTR_RETURN_NULL(position); 418 PS_CHECK_NULL_PTR_RETURN_NULL(offset); 419 396 420 psPlane lin; 397 421 psSphere* tmp; -
trunk/psLib/src/astronomy/psCoord.c
r2083 r2103 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-1 3 21:06:07$12 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-14 01:10:58 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 const psPlane* coords) 97 97 { 98 PS_CHECK_NULL_PTR_RETURN_NULL(transform); 99 PS_CHECK_NULL_PTR_RETURN_NULL(coords); 98 100 if (out == NULL) { 99 101 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 114 116 float magnitude) 115 117 { 118 PS_CHECK_NULL_PTR_RETURN_NULL(transform); 119 PS_CHECK_NULL_PTR_RETURN_NULL(coords); 116 120 if (out == NULL) { 117 121 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 151 155 const psSphere* coord) 152 156 { 157 PS_CHECK_NULL_PTR_RETURN_NULL(transform); 158 PS_CHECK_NULL_PTR_RETURN_NULL(coord); 153 159 double sinY = 0.0; 154 160 double cosY = 0.0; … … 216 222 XXX: Waiting for the definition of the PS_PROJ_PAR projection. 217 223 XXX: Waiting for the definition of the PS_PROJ_GLS projection. 224 XXX: get rid of the psAborts 218 225 *****************************************************************************/ 219 226 psPlane* psProject(const psSphere* coord, 220 227 const psProjection* projection) 221 228 { 229 PS_CHECK_NULL_PTR_RETURN_NULL(coord); 230 PS_CHECK_NULL_PTR_RETURN_NULL(projection); 231 222 232 float R = 0.0; 223 233 float alpha = 0.0; … … 254 264 } else if (projection->type == PS_PROJ_GLS) { 255 265 psAbort(__func__, "The projection type PS_PROJ_GLS is undefined.\n"); 266 } else { 267 psAbort(__func__, "Unknown projection type.\n"); 256 268 } 257 269 … … 262 274 XXX: Waiting for the definition of the PS_PROJ_PAR projection. 263 275 XXX: Waiting for the definition of the PS_PROJ_GLS projection. 276 XXX: get rid of the psAborts 264 277 *****************************************************************************/ 265 278 psSphere* psDeproject(const psPlane* coord, 266 279 const psProjection* projection) 267 280 { 281 PS_CHECK_NULL_PTR_RETURN_NULL(coord); 282 PS_CHECK_NULL_PTR_RETURN_NULL(projection); 283 268 284 float R = 0.0; 269 285 float chu = 0.0; … … 304 320 } else if (projection->type == PS_PROJ_GLS) { 305 321 psAbort(__func__, "The projection type PS_PROJ_GLG is undefined.\n"); 322 } else { 323 psAbort(__func__, "Unknown projection type.\n"); 306 324 } 307 325 … … 329 347 psSphereOffsetUnit unit) 330 348 { 349 PS_CHECK_NULL_PTR_RETURN_NULL(position1); 350 PS_CHECK_NULL_PTR_RETURN_NULL(position2); 351 331 352 psPlane* lin; 332 353 psProjection proj; … … 351 372 tmp->d = position2->d - position1->d; 352 373 353 // XXX:Wrap these to an acceptable range. This assumes that all374 // Wrap these to an acceptable range. This assumes that all 354 375 // angles are in radians. 355 376 tmp->r = fmod(tmp->r, 2*M_PI); … … 394 415 psSphereOffsetUnit unit) 395 416 { 417 PS_CHECK_NULL_PTR_RETURN_NULL(position); 418 PS_CHECK_NULL_PTR_RETURN_NULL(offset); 419 396 420 psPlane lin; 397 421 psSphere* tmp;
Note:
See TracChangeset
for help on using the changeset viewer.
