Changeset 2600 for trunk/psLib/src/astro/psCoord.c
- Timestamp:
- Dec 2, 2004, 11:12:52 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psCoord.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r2583 r2600 8 8 * @ingroup CoordinateTransform 9 9 * 10 * @author G eorge Gusciora, MHPCC10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-12-0 1 19:56:05$12 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-12-02 21:12:51 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 164 164 This function prototype has been modified since the SDRS. 165 165 *****************************************************************************/ 166 psSphereTransform* psSphereTransformAlloc(double NPlat,167 double Xo,168 double xo)166 psSphereTransform* psSphereTransformAlloc(double alphaP, 167 double deltaP, 168 double phiP) 169 169 { 170 170 psSphereTransform* tmp = (psSphereTransform* ) psAlloc(sizeof(psSphereTransform)); 171 171 172 tmp-> sinPhi = sin(NPlat);173 tmp-> cosPhi = cos(NPlat);174 tmp-> Xo = Xo;175 tmp-> xo = xo;172 tmp->cosDeltaP = cos(deltaP); 173 tmp->sinDeltaP = cos(deltaP); 174 tmp->alphaP = alphaP; 175 tmp->phiP = phiP; 176 176 177 177 return (tmp); … … 207 207 x = coord->r; 208 208 y = coord->d; 209 dx = x - transform-> xo;210 sinY = cos(y) * sin(dx) * transform->sin Phi + sin(y) * transform->cosPhi;209 dx = x - transform->phiP; 210 sinY = cos(y) * sin(dx) * transform->sinDeltaP + sin(y) * transform->cosDeltaP; 211 211 cosY = sqrt(1.0 - sinY * sinY); 212 sinX = (cos(y) * sin(dx) * transform->cos Phi - sin(y) * transform->sinPhi) / cos(y);212 sinX = (cos(y) * sin(dx) * transform->cosDeltaP - sin(y) * transform->sinDeltaP) / cos(y); 213 213 cosX = cos(y) * cos(dx) / cos(y); 214 214 215 out->r = atan2(sinX, cosX) + transform-> Xo;215 out->r = atan2(sinX, cosX) + transform->alphaP; 216 216 out->d = atan2(sinY, cosY); 217 217 … … 227 227 double T = year / 100.0; 228 228 double phi = -23.452294 + 0.013013 * T + 0.000001639 * T * T - 0.000000503 * T * T * T; 229 double Xo= 0.0;230 double xo= 0.0;229 double alphaP = 0.0; 230 double phiP = 0.0; 231 231 232 232 psFree(tmTime); 233 return (psSphereTransformAlloc(phi, Xo, xo));233 return (psSphereTransformAlloc(phi, alphaP, phiP)); 234 234 } 235 235 … … 242 242 double T = year / 100.0; 243 243 double phi = +23.452294 - 0.013013 * T - 0.000001639 * T * T + 0.000000503 * T * T * T; 244 double Xo= 0.0;245 double xo= 0.0;244 double alphaP = 0.0; 245 double phiP = 0.0; 246 246 247 247 psFree(tmTime); 248 return (psSphereTransformAlloc(phi, Xo, xo));248 return (psSphereTransformAlloc(phi, alphaP, phiP)); 249 249 } 250 250 … … 536 536 const psTime *toTime) 537 537 { 538 psF64 fromMJD = fromTime->sec/86400.0 + fromTime->usec/86400000000.0 + 40587.0; 539 psF64 toMJD = toTime->sec/86400.0 + toTime->usec/86400000000.0 + 40587.0; 540 psF64 = (toMJD - fromMJD) / 36525.0; 541 542 543 538 /* 539 psF64 fromMJD = fromTime->sec/86400.0 + fromTime->usec/86400000000.0 + 40587.0; 540 psF64 toMJD = toTime->sec/86400.0 + toTime->usec/86400000000.0 + 40587.0; 541 psF64 = (toMJD - fromMJD) / 36525.0; 542 */ 544 543 return(NULL); 545 544 }
Note:
See TracChangeset
for help on using the changeset viewer.
