yantra/patha/kala-dvara.js
काल-द्वार, the time door of the sovereign (vedha-yantra) engine.
240 lines · 0 exports
The header, as the file states it
What it loads
nothing
What it exports
SS verses named in the header
- SS 1.11verseprāṇādiḥ kathito mūrtastruṭyādyo amūrtasaṃjñakaḥ । ṣaḍbhiḥ prāṇairvināḍī syāttatṣaṣṭyā nāḍikā smṛtā ।।
- SS 1.12versenāḍīṣaṣṭyā tu nākṣatraṃ ahorātraṃ prakīrtitam । tattriṃśatā bhavenmāsaḥ sāvano arkodayaistathā ।।
- SS 13.23versetāmrapātraṃ adhaśchidraṃ nyastaṃ kuṇḍe amalāmbhasi । ṣaṣṭirmajjatyahorātre sphuṭaṃ yantraṃ kapālakam ।।
The channels it runs in
Every function, what it calls, who calls it
23 top-level functions read from the source; the doc line is the comment above each; calls and callers are resolved across the registry’s modules by name. Line numbers are the file’s at engine 3f94072.
Every time-count of a yuga, derived from the canon's three integers by the text's own rules.
A body's own risings in a yuga: the star-risings less its own revolutions (SS 1.34).
Spandas of the turn → spandas of the civil day (exact rational): × savana / nakshatra.
Spandas of the civil day → spandas of the turn (exact rational): × nakshatra / savana.
Time is angle: spandas of the turn → arcseconds the wheel has turned (exact rational, not reduced mod a turn).
Angle → spandas of the turn (deśāntara, hour angle, rising times in prāṇa): 1″ = 506,250 spandas.
Jyotirmīmāṃsā §14 (p.36): elapsed prāṇas × a body's own daily motion ÷ 21,600 = the arc it moved in that time. Exact, because a prāṇa is one kalā of the turn. Arguments are integers (prāṇas, arc-minutes); result is a rational in arc-minutes.
Civil days since the Kali epoch → spandas of the turn: exact {num, den} for a whole number of days (BigInt or integer); a fractional day count (a float) is put on the turn lattice, the nearest whole spanda (≤ 66 ns).
Spandas of the turn (BigInt or {num, den}) → civil days since the Kali epoch, exact {num, den}: τ·S/(N·R).
exportedSpandas of the turn since the Kali epoch for a kapāla reading taken on Kali day `kaliDay`, counted from that day's origin (exact rational). `calibration`: "nakshatra" (the bowl sinks 60 times per turn — SS 1.12 with 13.23; the default: its reading IS spandas of the turn, of the canon's own wheel) or "savana" (a bowl calibrated to sixty a civil day: its reading is that many sixtieths of a civil day
exportedThe same reading in the convention of bharat-ephemeris-offline (kept for its consumers): spandas of the CANON'S turn since the Kali epoch, the day's origin kaliDay × N × nakṣatra ÷ sāvana; "savana" = × nakṣatra ÷ sāvana. Exact { num, den } (den = the canon's sāvana). For the Sūrya-Siddhānta canon it equals turnSpandasAt.
One civil (sāvana) day of a canon in spandas of its turn: N × nakṣatra ÷ sāvana, exact, in lowest terms. The Sūrya-Siddhānta's is 259,526,559,737,700,000,000/394,479,457 (394,479,457 is prime: no civil day is a whole number of spandas, D1d).
Whole civil days elapsed from the Kali epoch to the civil day `year-month-day` (0 = Friday 18 Feb 3102 BCE Julian).
Civil date of a Kali day, in the requested calendar (astronomical years: 1 BCE = 0, 3102 BCE = −3101).
vāra of a Kali day: index 0 = ravivāra (Sunday) … 6 = śanivāra.
{ghaṭī, vināḍī, prāṇa, spanda} → spandas of whichever ahorātra the reading is counted in.
Spandas within one ahorātra (0 ≤ s < 656,100,000,000) → {ghaṭī, vināḍī, prāṇa, spanda}.