PROTECT YOUR DNA WITH QUANTUM TECHNOLOGY
Orgo-Life the new way to the future Advertising by Adpathway
// get a vector in ESU coordinates to a celestial body from a EUS position (like a camera or object)
// - body = (e.g "Sun", "Venus", "Moon", etc)
// - date = date of observation (Date object)
export function getCelestialDirection(body, date, pos) {
let LLA;
// if a position is provided, use that to calculate the LLA of the observer
// realistically this won't make any significant difference for the Sun,
// the biggest difference will be for the Moon, then nearby planets
if (pos !== undefined) {
LLA = EUSToLLA(pos);
} else {
// default to the local origin, should be fine for the sun.
LLA = V3(Sit.lat, Sit.lon, 0)
}
let observer = new Astronomy.Observer(LLA.x, LLA.y, LLA.z);
const celestialInfo = Astronomy.Equator(body, date, observer, false, true);
const ra = (celestialInfo.ra) / 24 * 2 * Math.PI; // Right Ascension NOTE, in hours, so 0..24 -> 0..2π
const dec = radians(celestialInfo.dec); // Declination
return getCelestialDirectionFromRaDec(ra, dec, date);
}















.png)






.jpg)



English (US) ·
French (CA) ·