JS CalcMoon() now uses a Time object like other high-level functions.

This will be handy if I need to use it to calculate moon phases.
Not sure yet.
This commit is contained in:
Don Cross
2019-04-16 20:36:11 -04:00
parent 61b4652a31
commit 83d852b2d1
2 changed files with 8 additions and 6 deletions

View File

@@ -365,7 +365,9 @@ function ecl2equ_vec(time, pos) {
];
}
function CalcMoon(T) {
function CalcMoon(time) {
const T = time.tt / 36525;
function DeclareArray1(xmin, xmax) {
var array = [];
var i;
@@ -1007,8 +1009,7 @@ Astronomy.SkyPos = function(gc_vector, observer) { // based on NOVAS place()
Astronomy.GeoMoon = function(date) {
var time = AstroTime(date);
var t = time.tt / 36525; // t = centuries since J2000.0 epoch
var moon = CalcMoon(t);
var moon = CalcMoon(time);
// Convert geocentric ecliptic spherical coords to cartesian coords.
var dist_cos_lat = moon.distance_au * Math.cos(moon.geo_eclip_lat);

View File

@@ -1202,7 +1202,9 @@ function ecl2equ_vec(time, pos) {
];
}
function CalcMoon(T) {
function CalcMoon(time) {
const T = time.tt / 36525;
function DeclareArray1(xmin, xmax) {
var array = [];
var i;
@@ -1844,8 +1846,7 @@ Astronomy.SkyPos = function(gc_vector, observer) { // based on NOVAS place()
Astronomy.GeoMoon = function(date) {
var time = AstroTime(date);
var t = time.tt / 36525; // t = centuries since J2000.0 epoch
var moon = CalcMoon(t);
var moon = CalcMoon(time);
// Convert geocentric ecliptic spherical coords to cartesian coords.
var dist_cos_lat = moon.distance_au * Math.cos(moon.geo_eclip_lat);