moontool/
lib.rs

1//! John Walker's moontool.c calculation routines, ported to Rust.
2//!
3//! This version is released under the 0BSD license, for lack of a
4//! proper "public domain license", but:
5//!
6//! > _Do what thou wilt shall be the whole of the law._
7//!
8//! Several versions of the tool can be found, including the original
9//! Sun Workstation version (moontool), the X Window System version
10//! (xmoontool), and two Windows versions (moontoolw), for 16 and
11//! 32-bit architectures.
12//!
13//! The major part of the code comes from the MOONCALC.C file, from
14//! moontoolw's 32-bit version (the most recent).
15//!
16//! Originally, the calculation routines had been extracted and made
17//! available only as a C library[^1], with the least possible amount of
18//! deviation from the original.
19//!
20//! This version takes some slight liberties to make the API more usable
21//! in comparison to the historical C one. But the calculation routines
22//! do not change, and yield the exact same results (see unit tests of
23//! both versions).
24//!
25//! [^1]: <https://github.com/qrichert/moontool/tree/main/moon>
26//!
27//! ## John Walker
28//!
29//! - <http://www.fourmilab.ch/>
30//! - <https://fourmilab.ch/moontool/>
31//! - <https://fourmilab.ch/moontoolw/>
32
33pub mod datetime;
34pub mod moon;