mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-03-23 17:03:37 -04:00
So now I'm interested in finding out if the JavaScript and C output can be brought more in agreement than the current value: ctest(Diff): Maximum numeric difference = 1.81899e-12, worst line number = 145936 This rules out the same discrepancy with JavaScript % operator versus C fmod().
23 lines
971 B
JavaScript
23 lines
971 B
JavaScript
'use strict';
|
|
const fs = require('fs');
|
|
const Astronomy = require('../source/js/astronomy.min.js');
|
|
|
|
function Run() {
|
|
const observer = Astronomy.MakeObserver(29, -81, 10);
|
|
const time = Astronomy.MakeTime(-93692.7685882873047376);
|
|
console.log(`time.ut = ${time.ut.toFixed(16)}`);
|
|
console.log(`time.tt = ${time.tt.toFixed(16)}`);
|
|
const body = 'Sun';
|
|
const j2000 = Astronomy.Equator(body, time, observer, false, false);
|
|
console.log(`j2000 ra = ${j2000.ra.toFixed(16)}`);
|
|
console.log(`j2000 dec = ${j2000.dec.toFixed(16)}`);
|
|
const ofdate = Astronomy.Equator(body, time, observer, true, true);
|
|
console.log(`ofdate ra = ${ofdate.ra.toFixed(16)}`);
|
|
console.log(`ofdate dec = ${ofdate.dec.toFixed(16)}`);
|
|
const hor = Astronomy.Horizon(time, observer, ofdate.ra, ofdate.dec, false);
|
|
console.log(`azimuth = ${hor.azimuth.toFixed(16)}`);
|
|
console.log(`altitude = ${hor.altitude.toFixed(16)}`);
|
|
}
|
|
|
|
Run();
|