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

बीज-संस्कार तन्त्र: the Sūrya-Siddhānta's grahas carried to the sky

432 lines · 41 exports

लेख · the header

The header, as the file states it

bija-samskara.js — बीज-संस्कार तन्त्र: the Sūrya-Siddhānta's grahas carried to the sky ===================================================================================== Technique of this engine (one of three; shastra-patha and anda-purnanka carry the other two): 1. मध्यम (the means) — the text's own integers, exactly: SS 1.29–1.34 bhagaṇas on 1,577,917,828 civil days, 452¾ yugas gone at the Kali start (1.45–1.47), the apsides and nodes by their kalpa revolutions (1.41–1.44). Days are counted from midnight at Laṅkā (the engine's ahargaṇa). 2. बीज (bīja) on every mean, in the paramparā's own slots — dhruva (an epoch shift), bīja (a rate, as Brahmagupta, Lalla and Gaṇeśa wrote it: revolutions added to the yuga), a slow vṛddhi — and the same on each mandocca and pāta; the epicycles re-measured (even and odd, SS 2.34–2.38), exactly as Parameśvara re-measured them for his Dṛggaṇita (1431 CE): "dṛk-siddhi": the text's numbers moved until computation meets observation. 3. Sun and Moon on the text's manda (SS 2.39, with the arc), the Moon with Muñjāla's dvitīya-saṃskāra (Laghumānasa, c. 932 CE: the second correction on 2(☾−☉) − kendra) and its pāta and 270′ latitude (SS 1.68, 2.57); the five star-planets on Nīlakaṇṭha's construction (Tantrasaṅgraha 2.68b–74): the manda-corrected heliocentric place on its kakṣyā, set on the true Sun — the śīghra triangle drawn exactly, its karṇa the distance. 4. फल-संस्कार (phala terms): the remaining corrections, each an amplitude × jyā/koṭijyā of a whole-number combination of the text's own (bīja-corrected) means — D, the anomalies, F, and the planets' heliocentric means — the owner's own gravity (his EIH-1PN N-body, Gauss–Radau / DOP853, his three-body Moon) supplying the amplitudes. Each family of terms is READ in bija-vyakhya.js (owner, 2026-10-31): the text's rule that one motion in yojanas is many motions in degrees by the size of the circle (SS 12.73, 12.75–12.77, 12.80) applied to the centre of each circle — the Earth about its common point with the Moon (D on the Sun), the Sun about its common point with Jupiter (E − J), Venus and Mars on the Earth's circle, the Sun on the Moon's (Muñjāla, Candraśekhara). patra().vyakhya carries it beside the numbers. 5. माधव-गणित: every jyā by Mādhava's series (R = 3437′44″48‴), every arc by his arc series with the tri-karaṇī (√3) step, π by his √12 series (madhava-ganita.js). No library trigonometry on this path. Every number of steps 2–4 is in bija-patra.json, measured by scripts/bija-mapana.js against the owner's N-body sky (1850–2150; fit and holdout grids interleaved), with its rms recorded beside it. Frame: nirayaṇa, Citrā-pakṣa — Citrā's yogatārā at 180° as SS 8.2–8.9 places it; the mean node. 6. काल-बीज (kāla-bīja): the civil day (sāvana, counted from Laṅkā midnight) lags uniform time as the Earth's spin slows and wanders. The grahas run on uniform days; the civil ahargaṇa is moved onto them by the measured lag (seconds, half-year knots, read from the same record that built the owner's sky: an observation record, not a formula). Without it the Moon alone carries ±5″ decade-scale drifts. Outside the measured window (without a dīrgha record) the bīja rates continue to ±5 centuries and are then held; slow (T²) and Poisson parts are held at the window's edge, and the kāla-bīja holds its edge value, so the text's own motion carries deep time. 7. दीर्घ-बीज (dīrgha, outside 1850–2150): the record's `dirgha` part, measured against the owner's own N-body (Gauss–Radau, his force law, ten bodies, from the bīja-corrected state) over 500–3000. The bīja rates run on (holdLinear: null); each body's phala keeps, fades or holds its slow parts as measured (ts); the slots — mean, mandocca, pāta, the manda ratio, the kakṣyā's eccentricity, the inclination, the Sun's and Moon's manda — are carried by polynomials in the centuries beyond the edge (zero at the edge); and each body has its dīrgha-phala, terms amplitude × jyā of a whole-number combination of the means in the record's own form (on the geocentric place, or on a star-planet's heliocentric place and distance), with aruṇa and varuṇa at their own means (dirgha.bahya). Guru and Śani outside take their construction with only its geocentric phala (mode 'core'), their orbits' phala being the dīrgha record's. The step at each edge is removed by an offset that tapers to zero, so the tier is continuous there; inside the window nothing changes. Beyond the measured span (span: centuries past the edge) the polynomials hold their end values. 8. बन्ध (candra-bandha.json): inside 1850–2150 the means of the Sun, the Moon, their uccas and Rāhu are the record's slot means re-written on whole numbers — each body's revolutions in a para (72,000,000 mahāyugas, SS 1.21) on the text's civil days, its place at the epoch (Laṅkā midnight, 1 January 2024) and the window's running (vṛddhi) in whole arc-spandas (N = 30⁸ to a turn, owner D1/D1a; re-derived on it, never rounded, D1b). They equal the slot means to < 1 µas; the synodic month is then the exact rational days / (R☾ − R☉) = 18935013936000000/641200008057937. The binding is a rule: the engine derives it, exactly, from whatever record it loads (deriveBandha), so every seal is bound; candra-bandha.json is its witness, rewritten by every seal script (scripts/bandha/build-candra-bandha.js) and checked digit for digit when it is the record's.
आवश्यक · requires

What it loads

required by
निर्यात · exports

What it exports

REVKALPA_APSISKALPA_NODEPLANETSBASISBIJA_MADHYAWINDOW_TPHALA_FAMILIEStextMeansbijaTimecorrectedMeanssunAtmoonAtplanetAtplanetCorebareOfcoreOfgrahasAtdirghaOfdirghaPhaladirghaHRdirghaBkalaBijamandaPhalaparidhitermSumtermPartsphalaCmprakashaVakratabijaGrahaspatrawrapmod360BANDHABANDHA_BODIESBANDHA_NBANDHA_EPOCHattachBandhabandhaForboundMeansderiveBandha
पाठ · the verses it cites

SS verses named in the header

  • SS 1.29verse
    yuge sūryajñaśukrāṇāṃ khacatuṣkaradārṇavāḥ । kujārkiguruśīghrāṇāṃ bhagaṇāḥ pūrvayāyinām ।।
  • SS 2.34verse
    ravermandaparidhyaṃśā manavaḥ śītago radāḥ ।
  • SS 2.39verse
    tadguṇe bhujakoṭijye bhagaṇāṃśavibhājite । tadbhujajyāphaladhanurmāndaṃ liptādikaṃ phalam ।।
  • SS 1.68verse
    bhacakraliptāśītyaṃśaṃ paramaṃ dakṣiṇottaram । vikṣipyate svapātena svakrāntyantādanuṣṇaguḥ ।।
  • SS 12.73verse
    bhacakraṃ dhruvayorbaddhaṃ ākṣiptaṃ pravahānilaiḥ । paryetyajasraṃ tannaddhā grahakakṣā yathākramam ।।
  • SS 8.2verse
    aṣṭārṇavāḥ śūnyakṛtāḥ pañcaṣaṣṭirnageṣavaḥ । aṣṭārthā abdhayo aṣṭāgā aṅgāgā manavastathā ।।
  • SS 8.3verse
    kṛteṣavo yugarasāḥ śūnyavāṇā viyadrasāḥ । khavedāḥ sāgaranagā gajāgāḥ sāgarartavaḥ ।।
  • SS 8.4verse
    manavo atha rasā vedā vaiśvaṃ āpyārdhabhogagam । āpyasyaivābhijitprānte vaiśvānte śravaṇasthitiḥ ।
  • SS 8.5verse
    tricatuḥ pādayoḥ sandhau śraviṣṭhā śravaṇasya tu । svabhogato viyannāgāḥ ṣaṭkṛtiryamalāśvinaḥ ।।
  • SS 8.6verse
    randhrādrayaḥ kramādeṣāṃ vikṣepāḥ svādapakramāt । diṅmāsaviṣayāḥ saumye yāmye pañca diśo nava ।।
  • SS 8.7verse
    saumye rasāḥ khaṃ yāmye agāḥ saumye khārkāstrayodaśa । dakṣiṇe rudrayamalāḥ saptatriṃśadathottare ।।
  • SS 8.8verse
    yāmya adhyardhatrikakṛtā nava sārdhaśareṣavaḥ । uttarasyāṃ tathā ṣaṣṭistriṃśatṣaṭtriṃśadeva hi ।।
  • SS 1.21verse
    paramāyuḥ śataṃ tasya tayāhorātrasaṃkhyayā । āyuṣo ardhamitaṃ tasya śeṣakalpo ayaṃ ādimaḥ ।।
नलिका · channels

The channels it runs in

कार्य · the functions

Every function, what it calls, who calls it

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

frac(x)lines 70–70
calls nothing in the registry
called by deg, boundMeans
turnsYuga(rev, t)lines 72–72

Turns of a body with `rev` revolutions a mahāyuga at civil day t (452¾ yugas gone at the Kali start).

calls nothing in the registry
called by textMeans
turnsKalpa(rev, t)lines 74–74

Turns of an apsis/node with `rev` revolutions a kalpa (1000 yugas).

calls nothing in the registry
called by textMeans
deg(turns)lines 75–75
calls frac
called by textMeans
mod360(x)lines 76–76exported
calls nothing in the registry
wrap(x)lines 77–77exported
calls mod360
called by nothing in the registry
textMeans(t)lines 80–91exported

The text's means at civil day t (degrees): SS 1.29–1.47, exact integers. Rāhu is the node's westward place.

bijaTime(t, P)lines 98–102exported

Bīja time: centuries from the window's middle, the linear part held at ±5, the slow part at ±1.6 — or as the record's dīrgha part says (holdLinear / holdSlow: null runs on).

calls nothing in the registry
called by correctedMeans
dirghaOf(T, P)lines 106–110exported

Which side of the window and how far beyond its edge (centuries, signed; held at the measured span), or null inside.

calls nothing in the registry
called by correctedMeans
polyU(a, u)lines 112–112

Σ a_k u^k, k = 1…: zero at the window's edge.

calls nothing in the registry
called by sidePoly
phalaCm(body, cm)lines 116–120exported

The slow time a body's phala sees outside: 'hold' the record's hold, { fade: c } from the edge's value to the middle's over c centuries, 'zero' the amplitudes as at the window's middle, 'run' carried on.

calls nothing in the registry
dirghaB(cm)lines 122–127exported

The basis the dīrgha-phala read: the record's, with aruṇa and varuṇa at the dīrgha record's own means.

calls mod360

One dīrgha-phala term in degrees (or a fraction, for 'radial'): amplitude a0 + Σ a_j |u|^j per side, on jyā/koṭijyā.

A body's dīrgha-phala on its geocentric place, and the edge step removed by the tapering offset. Returns [λ, β].

dirghaHR(body, cm, kp)lines 143–148exported

A star-planet's dīrgha-phala on its own orbit: [degrees on the heliocentric place, fraction on the distance].

called by planetAt
paridhi(Pe, Po, k)lines 151–151exported

The pulsating epicycle (SS 2.38): even − (even − odd)·|jyā κ|, as a fraction of the circle.

mandaPhala(Pe, Po, k)lines 153–153exported

SS 2.39 with the arc: the manda-phala of kendra κ (= mean − mandocca), degrees, subtractive while κ < 180°.

termParts(terms, B, Ts)lines 175–183exported

The same sum, term by term, for a page that shows the derivation: the argument a (deg, the whole-number combination of the basis), its jyā and koṭijyā, the measured amplitudes (s, c; their slopes sT, cT in Ts) and the term's value — exactly what termSum adds, so Σ value ≡ termSum(terms, B, Ts). Display only: kula-pariksha.js tests the families, this only lays them out.

bandhaSlots(P)lines 197–197
calls nothing in the registry
qgcd(a, b)lines 199–199

exact ratios [n, d] of BigInts, d > 0, in lowest terms

calls nothing in the registry
called by qn
qn(n, d = 1n)lines 200–200
calls qgcd
called by qadd, qmul, qdiv, qdec
qadd(x, y)lines 201–201
calls qn
qsub(x, y)lines 202–202
calls qadd
called by deriveBandha
qmul(x, y)lines 203–203
calls qn
called by deriveBandha
qdiv(x, y)lines 204–204
calls qn
called by deriveBandha
qfloor(x)lines 205–205
calls nothing in the registry
called by qround, deriveBandha
qround(x)lines 206–206
calls qfloor, qadd
called by deriveBandha
qdec(v)lines 208–213

a written decimal ("-0.005037463454212717", "1.2544256065135158e-12", or a number by its shortest decimal) as an exact ratio

calls qn
called by deriveBandha
deriveBandha(P)lines 215–239exported

The bandha of a record's params: whole counts, dhruva and vṛddhi (BigInt), with the epoch's kāla — exact.

called by loadBandha
loadBandha(rec)lines 241–254

The working bandha of a record: derived from its own slots, checked against the witness file when that is the record's.

attachBandha(rec)lines 257–257exported

Bind a record (as read from bija-patra.json): its params carry their bandha under a symbol key — not in the sealed JSON, kept by {...params}. Every record is bound; a new seal gets its own bandha from its own slots.

called by patra
bandhaFor(P)lines 259–264exported

The bandha that holds for P: present, with the Sun–Moon slots and the kāla it was made from — else null.

boundMeans(t, bd)lines 266–273exported

The bound means (degrees) at uniform day t: dhruva + R·Δ/days + vṛddhi·(Δ/36525)², the whole days of Δ taken exactly.

calls frac
called by correctedMeans
correctedMeans(t, P)lines 276–296exported

The corrected means and the basis vector at t, from the record's slots (inside the window the Sun–Moon means from the bandha).

lin(v, b)lines 278–278
calls mod360
called by correctedMeans
sunAt(cm0, P)lines 299–307exported

The true Sun: λ, its distance (mean = 1), and the parts.

planetCore(p, cm, Q, sun)lines 327–349exported

A star-planet on Nīlakaṇṭha's construction: the heliocentric manda-sphuṭa on its kakṣyā, set on the true Sun.

bareOf(Q)lines 353–353exported

The bare construction of a record entry: its slots without any phala term (cached per entry).

calls nothing in the registry
called by planetAt
coreOf(Q)lines 357–357exported

The core of a record entry: the construction with only its geocentric phala (geoTerms, sunRadTerms — the Earth's side of the figure); the planet's own orbit's phala (helio, radial, plane, latitude) left to the dīrgha record.

calls nothing in the registry
called by planetAt
planetAt(p, cm, P, sun)lines 360–369exported

A star-planet. Inside the measured window, the full record. Outside it, the dīrgha record (mode 'full' or 'core' or 'bare' for the construction; its slots on the manda ratio, the kakṣyā's eccentricity and the inclination; its dīrgha-phala).

kalaBija(t, K)lines 374–381exported

काल-बीज: seconds by which the civil instant t lags uniform time. K = { t0, step, sec: [...] } (knots step days apart from t0), linear between knots, the edge value held outside. Absent K → 0 (the record measured without it).

grahasAt(t, P)lines 399–409exported

The grahas at civil ahargaṇa t (the engine's day, D13 meridian): carried to the record's own day (meridian.recordDays, owner rule A 2026-11-02), moved onto uniform days by the kāla-bīja, then means → bīja → manda/śīghra → phala.

bijaGrahas(ahargana)lines 422–427exported

The nine grahas at an ahargaṇa (civil days since Laṅkā midnight at the Kali start; BigInt, Rational or number).