IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 9, 2005, 4:36:42 PM (21 years ago)
Author:
desonia
Message:

prepared the config/data directories to be installed into standard areas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r3114 r3182  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-02-03 00:45:06 $
     12*  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-02-10 02:36:41 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    267267{
    268268    while (angle < FLT_EPSILON) {
    269         angle+=M_PI;
    270     }
    271 
    272     while (angle >= M_PI) {
    273         angle-=M_PI;
     269        angle+=PS_PI;
     270    }
     271
     272    while (angle >= PS_PI) {
     273        angle-=PS_PI;
    274274    }
    275275    return(angle);
     
    547547        R = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y));
    548548        tmp->d = atan2(-coord->y, coord->x);
    549         tmp->r = acos((R * M_PI) / 180.0);
     549        tmp->r = acos((R * PS_PI) / 180.0);
    550550
    551551    } else if (projection->type == PS_PROJ_CAR) {
     
    555555    } else if (projection->type == PS_PROJ_MER) {
    556556        tmp->d = coord->x;
    557         tmp->r = (2.0 * atan(exp((coord->y * M_PI / 180.0)))) - 180.0;
     557        tmp->r = (2.0 * atan(exp((coord->y * PS_PI / 180.0)))) - 180.0;
    558558
    559559    } else if (projection->type == PS_PROJ_AIT) {
    560         chu1 = (coord->x * M_PI) / 720.0;
     560        chu1 = (coord->x * PS_PI) / 720.0;
    561561        chu1 *= chu1;
    562         chu2 = (coord->y * M_PI) / 360.0;
     562        chu2 = (coord->y * PS_PI) / 360.0;
    563563        chu2 *= chu2;
    564564        chu = PS_SQRT_F32(1.0 - chu1 - chu2);
    565         tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * M_PI) / 360.0);
    566         tmp->r = asin((coord->y * chu * M_PI) / 180.0);
     565        tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * PS_PI) / 360.0);
     566        tmp->r = asin((coord->y * chu * PS_PI) / 180.0);
    567567
    568568    } else if (projection->type == PS_PROJ_PAR) {
     
    640640        // Wrap these to an acceptable range.  This assumes that all
    641641        // angles are in radians.
    642         tmp->r = fmod(tmp->r, 2*M_PI);
    643         tmp->d = fmod(tmp->d, 2*M_PI);
     642        tmp->r = fmod(tmp->r, 2*PS_PI);
     643        tmp->d = fmod(tmp->d, 2*PS_PI);
    644644        tmp->rErr = 0.0;
    645645        tmp->dErr = 0.0;
     
    731731        tmp = (psSphere* ) psAlloc(sizeof(psSphere));
    732732        tmp->r = position->r + tmpR;
    733         tmp->r = fmod(tmp->r, 2.0*M_PI);
     733        tmp->r = fmod(tmp->r, 2.0*PS_PI);
    734734        tmp->d = position->d + tmpD;
    735         tmp->d = fmod(tmp->d, 2.0*M_PI);
     735        tmp->d = fmod(tmp->d, 2.0*PS_PI);
    736736        tmp->rErr = 0.0;
    737737        tmp->dErr = 0.0;
Note: See TracChangeset for help on using the changeset viewer.