IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 29, 2005, 4:17:17 PM (21 years ago)
Author:
drobbin
Message:

Edited psCubeToSphere, tests. EOC - gravity still fails. Others still unchecked.

File:
1 edited

Legend:

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

    r5624 r5626  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-11-30 02:00:00 $
     12*  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-11-30 02:17:17 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11371137    //    sphere->rErr = arctan(cube->xErr/cube->yErr);
    11381138    //    sphere->dErr = arctan(sqrt(cube->xErr*cube->xErr + cube->yErr*cube->yErr)/cube->zErr);
    1139     sphere->r = 1 / (atan(cube->x/cube->y));
    1140     sphere->d = 1 / (atan(sqrt(cube->x*cube->x + cube->y*cube->y)/cube->z));
    1141     sphere->rErr = 1 / (atan(cube->xErr/cube->yErr));
    1142     sphere->dErr = 1 / (atan(sqrt(cube->xErr*cube->xErr + cube->yErr*cube->yErr)/cube->zErr));
     1139    //    sphere->r = 1 / (atan(cube->x/cube->y));
     1140    //    sphere->d = 1 / (atan(sqrt(cube->x*cube->x + cube->y*cube->y)/cube->z));
     1141    //    sphere->rErr = 1 / (atan(cube->xErr/cube->yErr));
     1142    //    sphere->dErr = 1 / (atan(sqrt(cube->xErr*cube->xErr + cube->yErr*cube->yErr)/cube->zErr));
     1143    psCube *cube2 = psCubeAlloc();
     1144    *cube2 = *cube;
     1145    double mag = sqrt(cube->x*cube->x + cube->y*cube->y + cube->z*cube->z);
     1146    if (mag > 1.0) {
     1147        cube2->x = cube2->x/mag;
     1148        cube2->y = cube2->y/mag;
     1149        cube2->z = cube2->z/mag;
     1150    }
     1151
     1152    sphere->r = atan2(cube2->y, cube2->x);
     1153    sphere->d = asin(cube2->z);
     1154    //    sphere->d = atan2((cube->x*cube->x + cube->y*cube->y), cube->z);
     1155    sphere->rErr = atan2(cube2->yErr, cube2->xErr);
     1156    sphere->dErr = asin(cube2->zErr);
     1157    psFree(cube2);
    11431158
    11441159    return(sphere);
Note: See TracChangeset for help on using the changeset viewer.