Changeset 3884 for trunk/psLib/src/astro
- Timestamp:
- May 11, 2005, 12:02:16 PM (21 years ago)
- Location:
- trunk/psLib/src/astro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r3715 r3884 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.6 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 4-19 05:46:24$12 * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-05-11 22:02:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 326 326 { 327 327 while (angle < FLT_EPSILON) { 328 angle+= PS_PI*2;329 } 330 331 while (angle >= ( PS_PI*2)) {332 angle-= PS_PI*2;328 angle+=M_PI*2; 329 } 330 331 while (angle >= (M_PI*2)) { 332 angle-=M_PI*2; 333 333 } 334 334 return(angle); … … 509 509 } else if ( projection->type == PS_PROJ_PAR) { 510 510 out->x = phi*(2.0*cos(2.0*theta/3.0) - 1.0); 511 out->y = PS_PI*sin(theta/3.0);511 out->y = M_PI*sin(theta/3.0); 512 512 } else { 513 513 psError(PS_ERR_BAD_PARAMETER_TYPE, true, … … 558 558 // Parabolic deprojection 559 559 } else if ( projection->type == PS_PROJ_PAR) { 560 psF64 rho = y/ PS_PI;560 psF64 rho = y/M_PI; 561 561 phi = x/(1.0 - 4.0*rho*rho); 562 562 theta = 3.0*asin(rho); … … 647 647 // Wrap these to an acceptable range. This assumes that all 648 648 // angles are in radians. 649 tmp->r = fmod(tmp->r, 2* PS_PI);650 tmp->d = fmod(tmp->d, 2* PS_PI);649 tmp->r = fmod(tmp->r, 2*M_PI); 650 tmp->d = fmod(tmp->d, 2*M_PI); 651 651 tmp->rErr = 0.0; 652 652 tmp->dErr = 0.0; … … 760 760 // Add offset and wrap to 0 to 2PI if necessary 761 761 tmp->r = position->r + tmpR; 762 tmp->r = fmod(tmp->r, 2.0* PS_PI);762 tmp->r = fmod(tmp->r, 2.0*M_PI); 763 763 tmp->d = position->d + tmpD; 764 tmp->d = fmod(tmp->d, 2.0* PS_PI);764 tmp->d = fmod(tmp->d, 2.0*M_PI); 765 765 tmp->rErr = 0.0; 766 766 tmp->dErr = 0.0; -
trunk/psLib/src/astro/psTime.c
r3712 r3884 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 4-19 02:13:53$12 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-05-11 22:02:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 43 43 44 44 /** Two times pi with double precision accuracy */ 45 #define TWOPI (2.0* PS_PI)45 #define TWOPI (2.0*M_PI) 46 46 47 47 /** Conversion from radians to degrees */ 48 #define R2DEG = (180.0/ PS_PI)48 #define R2DEG = (180.0/M_PI) 49 49 50 50 /** Maximum length of time string */ … … 563 563 564 564 t = 2000.0 + (mjd - 51544.03)/365.2422; 565 dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0* PS_PI*t) + 0.007*cos(4.0*PS_PI*t);565 dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*M_PI*t) + 0.007*cos(4.0*M_PI*t); 566 566 result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1; 567 567 … … 692 692 } 693 693 694 // Create output sphere and convert arcsec to radians (i.e. x/60/60* PS_PI/180)694 // Create output sphere and convert arcsec to radians (i.e. x/60/60*M_PI/180) 695 695 output = psAlloc(sizeof(psSphere)); 696 output->r = x * PS_PI / 648000.0;697 output->d = y * PS_PI / 648000.0;696 output->r = x * M_PI / 648000.0; 697 output->d = y * M_PI / 648000.0; 698 698 699 699 return output;
Note:
See TracChangeset
for help on using the changeset viewer.
