Skip to main content

lunar_separation

Function lunar_separation 

Source
pub fn lunar_separation(
    target: Equatorial,
    at: OffsetDateTime,
    site: &Location,
) -> Angle
Expand description

Great-circle separation between the topocentric Moon and target at an instant. The target is precessed to the epoch of date internally, matching the observer-module semantics.

use skymath::{lunar_separation, Equatorial, Location, ParseMode};
use time::OffsetDateTime;

let m31 = Equatorial::parse_j2000("00:42:44.3", "+41:16:09", ParseMode::Strict)?;
let site = Location::parse("+52 05 32", "+004 18 27", 6.0)?;
let sep = lunar_separation(m31, OffsetDateTime::now_utc(), &site);
assert!((0.0..=180.0).contains(&sep.degrees()));