IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 11:25:59 AM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

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

    r2104 r2197  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-14 01:17:50 $
     12*  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-26 21:24:42 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5858/*****************************************************************************/
    5959
    60 static float p_psArg(float x, float y);
    61 
    62 /******************************************************************************
    63 XXX: Verify this arc tan function.
    64 XXX: macro
    65 XXX: I don't think this arg() is correct.
    66  *****************************************************************************/
    67 
    68 float p_psArg(float x,
    69               float y)
    70 {
    71     if (y!= 0.0) {
    72         return(atan(y/x));
    73     } else {
    74         return(0.5 * M_PI);
    75     }
    76     return (0.0);
    77     /*
    78         if (x > 0) {
    79             return (atan(y / x));
    80         } else if ((x == 0) && (y == 0)) {
    81             return (0.5 * M_PI);
    82         } else if ((x == 0) && (y == 0)) {
    83             return (-0.5 * M_PI);
    84         } else if ((x == 0) && (y == 0)) {
    85             return (M_PI + atan(y / x));
    86         } else if ((x == 0) && (y == 0)) {
    87             return (-M_PI + atan(y / x));
    88         }
    89         psAbort(__func__, "Unacceptable range for (p_psArg(%f, %f).\n", x, y);
    90     */
    91 }
    92 
    9360/*****************************************************************************/
    9461/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
     
    292259    if (projection->type == PS_PROJ_TAN) {
    293260        R = sqrt((coord->x * coord->x) + (coord->y * coord->y));
    294         tmp->d = p_psArg(-coord->y, coord->x);
     261        tmp->d = atan2(-coord->y, coord->x);
    295262        tmp->r = atan(180.0 / (R * M_PI));
    296263
    297264    } else if (projection->type == PS_PROJ_SIN) {
    298265        R = sqrt((coord->x * coord->x) + (coord->y * coord->y));
    299         tmp->d = p_psArg(-coord->y, coord->x);
     266        tmp->d = atan2(-coord->y, coord->x);
    300267        tmp->r = acos((R * M_PI) / 180.0);
    301268
     
    314281        chu2 *= chu2;
    315282        chu = sqrt(1.0 - chu1 - chu2);
    316         tmp->d = 2.0 * p_psArg((2.0 * chu * chu) - 1.0, (coord->x * chu * M_PI) / 360.0);
     283        tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * M_PI) / 360.0);
    317284        tmp->r = asin((coord->y * chu * M_PI) / 180.0);
    318285
Note: See TracChangeset for help on using the changeset viewer.