pluto.c   pluto.c 
/* /*
Copyright (C) 2001 Liam Girdwood <liam@nova-ioe.org> Copyright (C) 2001 Liam Girdwood <liam@nova-ioe.org>
Copyright (C) 2003 Fabien Chreau Copyright (C) 2003 Fabien Chereau
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Libary General Public License as published by it under the terms of the GNU Libary General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <math.h> #include <math.h>
#include "pluto.h" #include "pluto.h"
#include "misc_stellplanet.h"
#define PLUTO_COEFFS 43 #define PLUTO_COEFFS 43
#define PI 3.14159265358979323846264338327950288419716939937510 #define PI 3.14159265358979323846264338327950288419716939937510
static const struct pluto_argument argument[PLUTO_COEFFS] = { static const struct pluto_argument argument[PLUTO_COEFFS] = {
{0, 0, 1}, {0, 0, 1},
{0, 0, 2}, {0, 0, 2},
{0, 0, 3}, {0, 0, 3},
{0, 0, 4}, {0, 0, 4},
{0, 0, 5}, {0, 0, 5},
skipping to change at line 211 skipping to change at line 210
{273, 1065}, {273, 1065},
{251, 149}, {251, 149},
{-25, -9}, {-25, -9},
{9, -2}, {9, -2},
{-8, 7}, {-8, 7},
{2, -10}, {2, -10},
{19, 35}, {19, 35},
{10, 2} {10, 2}
}; };
/* Transform spheric coordinate in rectangular */
void sphe_to_rect(double lng, double lat, double r, double *x, double *y, d
ouble *z)
{
double cosLat = cos(lat);
(*x) = cos(lng) * cosLat;
(*y) = sin(lng) * cosLat;
(*z) = sin(lat);
(*x)*=r;
(*y)*=r;
(*z)*=r;
}
/* /*
Chap 37. Equ 37.1 Chap 37. Equ 37.1
params : Julian day, Longitude, Latitude, Radius params : Julian day, Longitude, Latitude, Radius
Calculate Pluto heliocentric ecliptical coordinates for given julian day. Calculate Pluto heliocentric ecliptical coordinates for given julian day.
This function is accurate to within 0.07" in longitude, 0.02" in latitude This function is accurate to within 0.07" in longitude, 0.02" in latitude
and 0.000006 AU in radius. and 0.000006 AU in radius.
Note: This function is not valid outside the period of 1885-2099. Note: This function is not valid outside the period of 1885-2099.
Longitude and Latitude are in radians, radius in AU. Longitude and Latitude are in radians, radius in AU.
*/ */
skipping to change at line 263 skipping to change at line 274
sum_radius += radius[i].A * sin_a + radius[i].B * cos_a; sum_radius += radius[i].A * sin_a + radius[i].B * cos_a;
} }
/* calc L, B, R */ /* calc L, B, R */
L = PI/180. * (238.958116 + 144.96 * t + sum_longitude * 0.000001); L = PI/180. * (238.958116 + 144.96 * t + sum_longitude * 0.000001);
B = PI/180. * (-3.908239 + sum_latitude * 0.000001); B = PI/180. * (-3.908239 + sum_latitude * 0.000001);
R = (40.7241346 + sum_radius * 0.0000001); R = (40.7241346 + sum_radius * 0.0000001);
/* convert to rectangular coord */ /* convert to rectangular coord */
sphe_to_rect(L, B, R, X, Y, Z); sphe_to_rect(L, B, R, X, Y, Z);
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 14 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/