Skip to main content

Crate sankhya

Crate sankhya 

Source
Expand description

§sankhya

sankhya (Sanskrit: सांख्य — enumeration/analysis) is a library of ancient mathematical systems, historical calendars, and archaeoastronomy for the AGNOS project.

Faithful implementations of computational traditions from eight civilizations, 10+ calendar systems, and archaeoastronomy tools — with cross-civilizational epoch correlation. Every algorithm cites its primary source.

§Modules

ModuleDomainHighlights
mayanMayaVigesimal numbers, Long Count, Tzolkin, Haab, Venus tables
babylonianBabylonSexagesimal numbers, Saros cycle, Plimpton 322, Heron’s sqrt
egyptianEgyptUnit fractions, doubling multiplication, stellar decans, Sothic cycle
vedicIndiaNikhilam multiplication, Sulba Sutra, Katapayadi, Meru Prastara
chineseChinaRod numerals, CRT, magic squares, Sexagenary 60-year cycle
greekGreeceGolden ratio, sieve, GCD, Archimedes’ pi, Antikythera, isopsephy
romanRomeRoman numeral conversion, validation, arithmetic (I–MMMCMXCIX)
islamicIslamAl-Khwarizmi algebra, Khayyam cubics, Hijri calendar
gregorianGlobalProleptic Gregorian calendar, JDN conversion
copticEgypt13-month Alexandrian calendar, Anno Martyrum
persianIranSolar Hijri (Jalaali), 2820-year leap cycle
hebrewIsraelLunisolar, Metonic cycle, molad, dehiyyot
aztecMesoamericaTonalpohualli (260-day), Xiuhpohualli (365-day)
epochCross-civilizationalPrecession, Seven Sages, unified convert() API
astroArchaeoastronomyCoordinates, star catalog, precession, heliacal rising, alignment

§Quick Start

use sankhya::mayan::LongCount;
use sankhya::babylonian;
use sankhya::greek;

// Convert days to Mayan Long Count
let lc = LongCount::from_days(1_872_000).unwrap(); // 13.0.0.0.0 (Dec 21, 2012)
assert_eq!(lc.baktun, 13);

// Babylonian square root (Heron's method, from YBC 7289 tablet)
let sqrt2 = babylonian::babylonian_sqrt(2.0, 10).unwrap();
assert!((sqrt2 - std::f64::consts::SQRT_2).abs() < 1e-15);

// Sieve of Eratosthenes
let primes = greek::sieve(100);
assert_eq!(primes.len(), 25); // 25 primes below 100

Re-exports§

pub use error::Result;
pub use error::SankhyaError;

Modules§

astro
Archaeoastronomy computations.
aztec
Aztec (Mexica) calendar systems.
babylonian
Babylonian mathematics.
chinese
Chinese mathematics.
coptic
Coptic (Alexandrian) calendar.
egyptian
Egyptian mathematics.
epoch
Cross-civilizational epoch correlation.
error
Error types for sankhya.
greek
Greek mathematics.
gregorian
Gregorian calendar.
hebrew
Hebrew (Jewish) calendar.
islamic
Islamic and Arabic mathematics.
mayan
Mayan mathematics and calendar systems.
persian
Persian (Solar Hijri / Jalaali) calendar.
roman
Roman numeral system.
vedic
Vedic and Indian mathematics.