भारत · ग्रहगणित
स्थान उज्जयिनी Ujjayinī · change it on a tool⌕ search the कोश ⌘Kप्रहर — · —:—:—ours, from sunriseउज्जयिनी —:—:—UTC + λ/15 h, λ = 75.7682° E (D13)IST Error −26.9 minlocal mean time − IST = 4λ − 330 min (K12)engine 3f94072the site ↗

yantra/patha/kala-dvara.js

काल-द्वार, the time door of the sovereign (vedha-yantra) engine.

240 lines · 0 exports

प्रमाण: पाठ SS 1.11–12 (the turn's units), 1.34, 1.37 (turns and civil days), 13.23 (the bowl) · गणित · स्वामी-परम्परा D1/D1a/D1c
लेख · the header

The header, as the file states it

kala-dvara.js — काल-द्वार, the time door of the sovereign (vedha-yantra) engine. प्रमाण: पाठ SS 1.11–12 (the turn's units), 1.34, 1.37 (turns and civil days), 13.23 (the bowl) · गणित · स्वामी-परम्परा D1/D1a/D1c THE CHAIN OF TIME, as the Sūrya-Siddhānta states it: 1.11 6 prāṇa = 1 vināḍī; 60 vināḍī = 1 nāḍikā (ghaṭī). 1.12 60 nāḍī = the NĀKṢATRA ahorātra — one turn of the star-wheel (bhacakra). So 21,600 prāṇa = 21,600 kalā = 360°: a prāṇa is the time of one arc-minute of that turn. TIME IS THE ANGLE THE WHEEL HAS TURNED. On the spanda lattice (656,100,000,000 = 30⁸ per turn: owner D1, D1a) 1″ of the turn = 506,250 spandas, 1 prāṇa = 1′ = 30,375,000, 1 nāḍī = 6° = 10,935,000,000. The clock is the turn (D1c, the pure turn clock): every time here is counted in spandas of the turn, and a civil day is R/S turns — 30⁸·1,582,237,828/1,577,917,828 spandas, an exact rational that is never whole (SAVANA_DAY; turnSpandasOfDays, turnSpandasAt and daysOfTurnSpandas are the only doors between the two). THE LATTICE AND ITS SOURCES (corpus/sources/time-units.json, "canonical"; owner decision P1, 2026-10-08): only SS 1.11-1.12 is the text here — 6 prāṇa, 60 vināḍī, 60 nāḍī to the turn — and it reaches down to the prāṇa and no further (SS 1.11 names the truṭi but gives it no ratio). Below the prāṇa the lattice is the engine's chain (math-core.js SUBDAY_CHAIN): its twelve steps paramāṇu → ahorātra carry the label 'Bhāgavata 3.11' in code only, a claim awaiting an edition [claim-only; no Bhāgavata text is in any repository]; the thirteenth factor, 100 spandas to a paramāṇu, is an engine choice [claim-only; no located source; 200 on 30⁸] that makes 1″ of the turn a whole number of cells. This file divides the lattice only by SS 1.11-1.12. Names: 'pala' = 1/60 ghaṭī (= vināḍī), vipala = 1/60 pala [standard; no local text] (time-units.json, P1). 1.34 In a yuga the stars rise 1,582,237,828 times; a body's own risings are that count less its own revolutions. 1.39 So the Sun's own risings — the civil (sāvana) days, sunrise to sunrise (1.36, 14.18) — are the star-risings less the Sun's 4,320,000 revolutions: 1,577,917,828. 1.35 Lunar months = Moon revolutions − Sun revolutions; adhimāsa = lunar months − solar months. 14.14 30 tithis a lunar month; 1.36 tithikṣaya = tithis − civil days. 14.19 Mean daily motions are counted by the civil day. Every count of every kind of day, month and year therefore follows exactly from three integers: the turns of the wheel, and the Sun's and the Moon's revolutions. This module carries both canons that the Kerala records need: the Sūrya-Siddhānta's, and Āryabhaṭa's (rotations 1,582,237,500, Gītikāpāda 3). The kapāla bowl sinks 60 times in an ahorātra (SS 13.23), and the ahorātra of 60 nāḍī is the nākṣatra one (1.12): a bowl is calibrated on two transits of the same star, and its readings are nāḍīs of the TURN. They become civil time only through the identity above, never by assuming the two days are equal. Also: civil date (Julian or Gregorian, proleptic) ↔ Kali-ahargaṇa (civil days since Friday 18 Feb 3102 BCE Julian, JD 588465.5 at 0h); vāra. No imports, no floating point, no Earth-rotation correction: the clock IS the rotation, so nothing has to be converted to or from it. Both calendars are proleptic, with astronomical year numbers (0 = 1 BCE, −3101 = 3102 BCE, −50000 = 50001 BCE), and hold for every integer year: below JDN 0 a date is carried up by whole cycles (146,097 days = 400 Gregorian years; 1,461 days = 4 Julian years) and carried back. Tested over −50,000 … +50,000 years, against round trips and independently against sums of year lengths (kala-dvara.test.js). Browser: window.KalaDvara; node: module.exports.
आवश्यक · requires

What it loads

nothing

required by
निर्यात · exports

What it exports

पाठ · the verses it cites

SS verses named in the header

  • SS 1.11verse
    prāṇādiḥ kathito mūrtastruṭyādyo amūrtasaṃjñakaḥ । ṣaḍbhiḥ prāṇairvināḍī syāttatṣaṣṭyā nāḍikā smṛtā ।।
  • SS 1.12verse
    nāḍīṣaṣṭyā tu nākṣatraṃ ahorātraṃ prakīrtitam । tattriṃśatā bhavenmāsaḥ sāvano arkodayaistathā ।।
  • SS 13.23verse
    tāmrapātraṃ adhaśchidraṃ nyastaṃ kuṇḍe amalāmbhasi । ṣaṣṭirmajjatyahorātre sphuṭaṃ yantraṃ kapālakam ।।
नलिका · channels

The channels it runs in

कार्य · the functions

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.

canonOf(name)lines 66–66
calls nothing in the registry
called by mana, udayaCount
mana(canonName = "surya")lines 69–79exported

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).

calls canonOf, big
called by nothing in the registry

Spandas of the turn → spandas of the civil day (exact rational): × savana / nakshatra.

calls mana, big
called by nothing in the registry

Spandas of the civil day → spandas of the turn (exact rational): × nakshatra / savana.

calls mana, big
called by nothing in the registry
arcsecOfTurn(spandas)lines 95–95exported

Time is angle: spandas of the turn → arcseconds the wheel has turned (exact rational, not reduced mod a turn).

calls big
called by nothing in the registry
turnSpandasFromArcsec(arcsec)lines 97–97exported

Angle → spandas of the turn (deśāntara, hour angle, rising times in prāṇa): 1″ = 506,250 spandas.

calls big
called by nothing in the registry

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.

calls big
called by nothing in the registry
floorDiv(a, b)lines 111–111
calls nothing in the registry
turnSpandasOfDays(days)lines 114–119exported

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).

daysOfTurnSpandas(t)lines 121–124exported

Spandas of the turn (BigInt or {num, den}) → civil days since the Kali epoch, exact {num, den}: τ·S/(N·R).

Spandas 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

calls nothing in the registry
called by nothing in the registry

The 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.

calls nothing in the registry
called by nothing in the registry
savanaDay(canonName = "surya")lines 154–158exported

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).

calls mana
called by nothing in the registry
isInt(x)lines 162–162
calls nothing in the registry

Whole civil days elapsed from the Kali epoch to the civil day `year-month-day` (0 = Friday 18 Feb 3102 BCE Julian).

civilFromKaliDay(n, calendar)lines 206–209exported

Civil date of a Kali day, in the requested calendar (astronomical years: 1 BCE = 0, 3102 BCE = −3101).

varaOfKaliDay(n)lines 211–215exported

vāra of a Kali day: index 0 = ravivāra (Sunday) … 6 = śanivāra.

calls isInt
called by nothing in the registry

{ghaṭī, vināḍī, prāṇa, spanda} → spandas of whichever ahorātra the reading is counted in.

calls nothing in the registry
called by nothing in the registry
spandasToKapala(s)lines 223–232exported

Spandas within one ahorātra (0 ≤ s < 656,100,000,000) → {ghaṭī, vināḍī, prāṇa, spanda}.

calls big
called by nothing in the registry