mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-24 16:56:39 -04:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user