भारत · ग्रहगणित
स्थान उज्जयिनी 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 ↗

spanda/zi-compat.js

Spanda Observatory's door onto the one engine (एक-यन्त्र): the surface of ZI (the observatory's own

348 lines · 3 exports

लेख · the header

The header, as the file states it

spanda/zi-compat.js — Spanda Observatory's door onto the one engine (एक-यन्त्र): the surface of ZI (the observatory's own Sūrya-Siddhānta lattice computer, v0–v9) and of AM (the owner's Āryabhaṭa–SS machine, v6–v9), the ~45 names its 19 page assets call, answered by bharat-ephemeris. The pages are not changed for this; what they show changes, by design: · the lattice is D1's: N = 30⁸ spanda per nākṣatra turn (SS 1.11-1.12: sixty nāḍīs make the turn, a prāṇa is one kalā of it), so ZI's identity 1 prāṇa ≡ 1 kalā = N/21600 is exact here, not approximate as on the civil day (ZI had N = 30⁷ per sāvana day). T = fromMs(ms) counts spandas of the turn since the Kali epoch (kala-dvara: the one clock, D1c); Y = R = 1,582,237,828, the turns in a mahāyuga (SS 1.34) — so T·YV/(Y·N) is still the Kali years gone, and B·N/Y a body's mean motion per turn. SAVANA (1,577,917,828, SS 1.37) is beside it. · the day's own quantities (dina, sunrise, noon, sunset, dinamāna, iṣṭa-kāla, the kāla windows, grahaṇa durations) keep ZI's reading — sixtieths of the civil day (the sāvana nāḍī the pañcāṅgas print), scaled so that N is one civil day — because every page's arithmetic on them (mod N, ÷ N, kalaRupa) assumes it. The engine's panchanga gives the turn-nāḍī beside the civil one; this door gives the civil one. ahargana(T) is the civil Kali day. · places are the engine's served bīja tier (bija-samskara, Rāhu–Ketu on the crossing tracks of rahu-ketu-sandhi), not ZI's bare text nor AM's machine; the text's four steps (ss-graha, SS 2.43-2.45) are shown beside them, and `bija` is the difference. Rates are per civil day (SS 2.47 dina-bhukti, what a pañcāṅga prints). · THE FRAME CHOOSES THE AYANĀṂŚA, NEVER A GRAHA'S PLACE (owner D23, D23a(2), D23b, 2026-11-14): every graha place here is the served one in every frame. ZI.frame is 'udaya-bija' by default — the served A, one A on every product (D23b(2), D23a(1)) — or 'patha' (SS 3.9-3.12 as written, the libration: Spanda's frame from v0 until D23b), both the owner's. The frame's A reaches what is counted from the equinox, through the Sun's sāyana place (served nirayaṇa + A_frame): krānti, cara, sunrise, noon, sunset, dinamāna and the kāla windows, ayana and ṛtu. Lagna, madhya-lagna and RAMC come from udaya-bija's sphere (the measured sky) on one path; the nirayaṇa lagna is that sāyana lagna less A_frame (D23b(1)), so in 'patha' the lagna moves by A_served − A_patha while the grahas stay. The dṛk doors (chaya, solarTime, riseSet, lambana's shift) show what is seen, on the measured sky. D20's shift of every place by A_bija − A_patha is withdrawn. No Citrā-pakṣa, no Lahiri on these pages (the owner, 2026-10-31: the star is not fixed); the D19 civil→turn patch in ZI.lagnaSpec is gone with ZI. · the names (zi-names.js) and the BPHS / SS-4 arithmetic on the lattice (zi-hora.js: varga, aṣṭakavarga, gocāra, Viṃśottarī, grahaṇa bimba, the display forms) are ZI's own lines, verbatim. · D13: the meridian is the engine's (meridian.js MERIDIAN_DEG, the Mahākāleśvara jyotirliṅga; owner 2026-11-01); the records keep their own day (rule A) · the default observer (ganana, natal) is the site, read from meridian.js (owner D23b(3), 2026-11-14); Rohtak only when the caller gives it pramāṇa: गणित (the lattice arithmetic) · पाठ (SS 1.11-1.12, 1.34, 1.37, 2.43-2.47, 3.9-3.17, 3.42-3.49, 14; BPHS 6, 66, 69; Āryabhaṭīya 1.7) · भारतीय-रूप·पुनर्मापित (the bīja tier's places and frame) · स्वामी-परम्परा (the frame rulings D23a, D23b: the frame chooses A only; udaya-bīja the default). Computation, not prediction (D11): the disclaimer rides on every gaṇanā. Built by tools/build.js into dist/zi-compat.js (IIFE; installs window.ZI and window.AM when a window exists). In node: require('./spanda/zi-compat.js') → { ZI, AM }.
आवश्यक · requires

What it loads

required by
nothing in the registry
निर्यात · exports

What it exports

ZIAMENGINE
पाठ · 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.34verse
    bhānāṃ aṣṭākṣivasvadritridvidvyaṣṭaśarendavaḥ । bhodayā bhagaṇaiḥ svaiḥ svairūnāḥ svasvodayā yuge ।।
  • SS 1.37verse
    vasudvyaṣṭādrirūpāṅkasaptādritithayo yuge । cāndrāḥ khāṣṭakhakhavyomakhāgnikhartuniśākarāḥ ।।
  • SS 2.43verse
    māndaṃ karmaikaṃ arkendorbhaumādīnāṃ athocyate । śaighryaṃ māndaṃ punarmāndaṃ śaighryaṃ catvāryanukramāt ।।
  • SS 2.47verse
    svamandabhuktisaṃśuddhā madhyabhuktirniśāpateḥ । dorjyāntarādikaṃ kṛtvā bhuktāvṛṇadhanaṃ bhavet ।।
  • SS 3.9verse
    triṃśatkṛtyo yuge bhānāṃ cakraṃ prākparilambate । tadguṇādbhūdinairbhaktāddyugaṇādyadavāpyate ।।
नलिका · channels

The channels it runs in

not on a channel
कार्य · the functions

Every function, what it calls, who calls it

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

sdiff(a, b)lines 58–58
calls mod
called by grahaAt
idiv(a, b)lines 59–59
calls nothing in the registry
called by tOfDays
isqrt(n)lines 60–60
calls nothing in the registry
called by sighraPhala, desa
jdOfMs(ms)lines 67–67
calls nothing in the registry
called by fromMs
daysOfT(T)lines 69–69

civil days since the Kali epoch (midnight at Laṅkā–Ujjayinī) ↔ T

fromMs(ms)lines 71–71
toMs(T)lines 72–72
called by nothing in the registry
fromDeg(x)lines 73–73
calls nothing in the registry
toDeg(sp)lines 74–74
calls nothing in the registry
called by desa, dinamana, drikShape

The civil day holding T at longitude lonDeg: the local Kali day (BigInt) and the fraction of that civil day, as spanda of N (ZI's `dina`: N ≡ one civil day for the day's own quantities).

calls daysOfT
called by ahargana, dinaOf
ahargana(T, lonDeg)lines 84–84
calls civilOf
called by nothing in the registry
dinaOf(T, lonDeg)lines 85–85
calls civilOf
called by nothing in the registry

an engine instant (civil days since the epoch) → spanda of local civil day `ah` at longitude lonDeg (may exceed N for the next day's instants, as ZI's dm.set and nextRise did)

calls nothing in the registry
called by dinamana
jya(sp)lines 93–94
koti(sp)lines 95–95
calls jya
called by sighraPhala
capa(j)lines 96–96
calls nothing in the registry
paridhi(p, k)lines 98–98

SS 2.38: the epicycle at a kendra from its even-end and odd-end values (kalā ×S)

calls jya
mandaPhala(g, m, u)lines 110–110

SS 2.39: the manda equation (spanda) for mean m and ucca u — the text's formula on the text's table

calls mod, jya, paridhi, capa
called by nothing in the registry
sighraPhala(g, m, s)lines 112–113

SS 2.40-2.42: the śīghra equation (spanda) and karṇa (×S, R = 3438)

called by nothing in the registry
madh(T, B, k = 0n)lines 115–115

SS 1.53: the mean place of a body with B revolutions a yuga at T (spanda of the turn) — the text's mean, on this lattice

calls mod
called by nothing in the registry
kalpaB(T, Bk, neg)lines 116–116
calls mod
called by nothing in the registry
lazy(o, k, f)lines 122–122
calls nothing in the registry
called by grahaAt, panchanga
degS(x)lines 123–123
calls nothing in the registry
called by grahaAt
grahaGati(T)lines 148–148

every body with its daily motion (spanda per civil day, SS 2.47) and vakrī flag

calls grahaAt
called by nothing in the registry
sunMean(T)lines 151–151
called by nothing in the registry
calls nothing in the registry
ayanamsa(T)lines 163–163
called by dinamana
calendarOf(frame)lines 167–167
calls nothing in the registry
called by dinamana
onLattice(lonDeg)lines 169–169

a served place (degrees, nirayaṇa) on the lattice — the same in every frame (D23a(2))

desa(latSp, lonSp)lines 174–185
called by nothing in the registry
siteOf(D)lines 186–186
calls nothing in the registry
called by dinamana
dinamana(D, aharLoc)lines 190–203

sunrise, noon, sunset of the local civil day aharLoc at D, as spanda of that day (N ≡ the civil day) — the engine's calendar on the bīja Sun (text rule: the Sun's centre on the horizon, no refraction), its sāyana place = served + the frame's A (D23, D23b(1)); in the served frame the web door's own instants

lagnaOf(T, D, frame)lines 207–207

the sāyana lagna of the measured sky less A of `frame` (D23b(1)): in 'patha' the lagna moves by A_served − A_patha, the grahas do not. A gaṇanā passes its own frame, so a lagna read later is still in the gaṇanā's frame.

lagnaSpec(T, D)lines 209–209

ZI's name: the lagna in the frame in force (ZI's older pages pass a Sun and an ayanāṃśa after D: both ignored, as before)

calls lagnaOf
called by lagnaDrk, lagnaAt
lagnaDrk(T, lat, lon)lines 210–210
calls lagnaSpec
called by nothing in the registry

दृक्-लम्बन: the Moon (or a graha) from the place, on the measured sky; its place is the served one in every frame (D23a(2)) — { sp, sara, lambana, nati, hp (spanda), alt (deg), r (Earth-radii) }

called by nothing in the registry
lagnaAt(T, D)lines 215–215
calls lagnaSpec
called by nothing in the registry
bhava(L, X)lines 217–219

Śrīpati's bhāvas from lagna and madhya-lagna (BPHS/Śrīpati; ZI's arithmetic)

calls mod
called by nothing in the registry
kaliYears(T)lines 226–226

── पञ्चाङ्ग · the engine's limbs in ZI's shape ─────────────────────────────────────────────────────────────────────

calls nothing in the registry
called by panchanga
called by nothing in the registry
endT(key)lines 229–229
calls tOfDays
called by panchanga
kshana(T, f, rate)lines 260–260

Newton on the lattice toward a target of f (ZI's kṣaṇa), kept for callers; rates are per civil day

calls nothing in the registry
elong(T)lines 261–261
calls mod
called by nothing in the registry
toTarget(cur, target)lines 262–262
calls mod
setFrame(name)lines 269–269
calls nothing in the registry
called by nothing in the registry
ganana(p = {})lines 270–270
calls nothing in the registry
called by nothing in the registry
amAt(ms)lines 322–322

AM's instant is the same turn-spanda ZI reads (fromMs → daysOfT), so ZI.grahaAt and AM.at agree to the spanda by construction

called by nothing in the registry
sunPair(ms)lines 323–323
called by nothing in the registry
drikShape(ms)lines 324–324
called by nothing in the registry

SS 4: the eclipse geometry on the given rates (kalā/day) and the Moon's latitude (kalā) — ZI/AM's lines

calls nothing in the registry
called by nothing in the registry
calls nothing in the registry
called by nothing in the registry