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

बन्ध-तन्त्र: the closed system of the Sūrya-Siddhānta's integers

856 lines · 60 exports

लेख · the header

The header, as the file states it

purnanka-bandha-tantra.js — बन्ध-तन्त्र: the closed system of the Sūrya-Siddhānta's integers Nothing here is fitted and nothing is compared. Every quantity is the text's own integer or an exact rational built from it (BigInt), so every identity below either holds exactly or is reported with its exact residual. 1 Frame the circle 21,600′ = 2⁵·3³·5², the turn 30⁸ = 2⁸·3⁸·5⁸ spandas (owner D1/D1a: the nākṣatra ahorātra), the mahāyuga 4,320,000 = 2⁸·3³·5⁴ years 2 Motion θ_k = R_k·t (turns, t in mahāyugas), R_k the integer bhagaṇa (SS 1.29–1.44); exact rational at every instant 3 Locks φ = p·θ_j ∓ q·θ_k; rate p·R_j ∓ q·R_k (an integer per yuga), corners p−q and p+q; it closes |rate| times a yuga. The basis: 8 rate locks (the frame lock Earth−Sun = the civil day, and the 7 relative locks k−Sun) + 1 phase lock (Ketu = Rāhu + half a turn). The calendar's own integers (SS 1.35–1.40) are these locks. 4 Pulse z = a·e^{iθ} + b·e^{iθ′}: the mean point and its epicycle (SS 2.34–2.42); |z|² = a² + b² + 2ab·cos Δ, the karṇa; the epicycle breathes, p(κ) = p_even − (p_even − p_odd)·|sin κ|/R (SS 2.38) 5 Abhijit R_k/R_{k+1} = N_k + f_k down the chain; the product telescopes exactly; C/M = 27 + f (the 28th, Abhijit), M/S = 13 + f′ where f′·S = the adhika months (12 + 1); Rāhu/Ketu = 1 with leftover 0 6 ℤ/9 owner's numbering 0 Earth, 1 Moon, 2 Sun, 3 Maṅgala, 4 Budha, 5 Guru, 6 Śukra, 7 Śani, 8 Rāhu, 9 Ketu (≡ 0) 7 Rings an N-ring and an M-ring share gcd(N, M) points, N·M = gcd·lcm, 0 is common to all; 108 = 12·9 = 27·4 8 Axis 0 (Earth) is the fixed point of every map on every ring The four steps (SS 2.43–2.45) that turn θ into the true place stay those of purnanka-graha-engine.js; `sthiti` reads them. §9–10, the bandha tier, complete the system from the owner's own gravity (bandha-patra.json): the same frame, motion, locks and pulses with his integers, epochs and amplitudes — see there.
आवश्यक · requires

What it loads

required by
निर्यात · exports

What it exports

FRAMENAVAthetathetaDayslocklockNRATE_LOCKSPHASE_LOCKNAMED_LOCKSclosurekalpaClosurepulsepythagoreanResidualchainABHIJITZ9doublingOrbitsringMeetVARGOTTAMA_108GANDANTAsthitifactorverifytiersinScosSargSsnapjyaKpatratauOfanglesAtvectorBapparentBbandhaGrahabandhaGrahasbandhaPanchangalimbEndsunrisekaliDayFromCivilTimecivilTimeFromKaliDayUJJAYINIlokasLOKA_WHEELSLOKA_UNITSlokaOfreturnsPerseedbijaSeedN_DAYLADDERlokaTurnsin30cos30arg30lokaGrahalokaGrahaslokaPanchangasunrise30ayanamsha30
पाठ · 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 1.35verse
    bhavanti śaśino māsāḥ sūryendubhagaṇāntaram । ravimāsonitāste tu śeṣāḥ syuradhimāsakāḥ ।।
  • SS 2.34verse
    ravermandaparidhyaṃśā manavaḥ śītago radāḥ ।
  • SS 2.38verse
    ojayugmāntaraguṇā bhujajyā trijyayoddhṛtā । yugme vṛtte dhanarṇaṃ syādojādūnādhike sphuṭam ।।
  • SS 2.43verse
    māndaṃ karmaikaṃ arkendorbhaumādīnāṃ athocyate । śaighryaṃ māndaṃ punarmāndaṃ śaighryaṃ catvāryanukramāt ।।
नलिका · channels

The channels it runs in

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

Every function, what it calls, who calls it

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

absB(x)lines 34–34

── 0. small exact helpers ──────────────────────────────────────────────────

calls nothing in the registry
lcmB(a, b)lines 36–36
powMod(b, e, m)lines 38–38
calls modB
called by verify
factor(n)lines 39–44exported
calls absB
called by smooth235, verify, fstr
smooth235(n)lines 45–45
calls factor
called by verify
LADDER(()lines 61–73exported

the 16-rung ladder (owner, 2026-10-27, Bhāgavata 3.11.5–8): 2 paramāṇu = 1 aṇu, 3 aṇu = 1 trasareṇu, 3 trasareṇu = 1 truṭi, then 100 truṭi = vedha, 3 vedha = lava, 3 lava = nimeṣa, 3 nimeṣa = kṣaṇa, 5 kṣaṇa = kāṣṭhā, 15 kāṣṭhā = laghu, 15 laghu = ghaṭikā. The rungs are of the TURN (D1a; the paramāṇu read on the turn is स्वामी-परम्परा, O4). On 30⁸ the truṭi is 3,600 spandas, the trasareṇu 1,200, th

called by nothing in the registry
rungOf(name)lines 74–74
calls nothing in the registry
called by nothing in the registry
rateOf(k)lines 103–103
calls nothing in the registry
called by lock, lockN, closure, verify
theta(key, tYugaQ)lines 106–110exported

θ in turns at t mahāyugas from a common zero (Ketu carries its half turn). Exact; reduced to [0, 1).

thetaDays(key, daysQ)lines 112–112exported

the same from civil days: t = days / C.

called by verify

φ = p·θ_j − s·q·θ_k with s = +1 (expanding, difference) or −1 (collapsing, sum). rate (integer revolutions per yuga), period in years and civil days (exact rationals), corners p−q and p+q.

lockN(terms)lines 132–136exported

a lock on any number of bodies: Σ c_k θ_k (integer coefficients); coefficient sum = the d'Alembert count.

called by nothing in the registry
closure(keys)lines 165–168exported

the first instant (in yugas) at which every listed wheel is back at its start together: 1/gcd(rates).

kalpaClosure()lines 170–174exported

with the apsides and nodes (kalpa revolutions, SS 1.41–1.44): rates in revolutions per kalpa.

cosR(kappaArcmin)lines 177–177

── 4. Pulse: mean point (radius R) + epicycle (radius r = p·R/360) ───────────────────────────────────────────────

pulse(key, kind, kappaArcminQ)lines 183–192exported

The pulse for one body, kind 'manda' or 'sighra', at the bhuja κ ∈ [0, 5400′] (the quadrant argument). Returns the breathing circumference p(κ) (degrees), r, the doḥ- and koṭi-phala, and the karṇa² = (R + koṭi)² + doḥ² — the |a e^{iθ} + b e^{iθ′}|² with a = R, b = r, Δ = κ, all exact rationals on the text's 24 R-sines.

pythagoreanResidual(kappaArcminQ)lines 194–194exported

the Pythagorean residual of the text's sines: sin² + cos² − R², at κ (exact). It is the only gap between the two forms.

chain(values)lines 198–207exported

a chain of integer rates (or day-counts) a_0, a_1, …: each a_k/a_{k+1} = N_k + f_k; the product telescopes to a_0/a_n.

called by verify
doublingOrbits(modulus)lines 229–238exported

orbits of ×2 on ℤ/3^k (the cascade 2·3^{k−1} + 2·3^{k−2} + … + 2 + 1 = 3^k).

ringMeet(N, M)lines 242–246exported

an N-ring and an M-ring on the one circle: their common points (in arcmin), count = gcd.

sthiti(daysQ)lines 254–259exported

the nine in the owner's order at Kali-day `days`: θ (mean, exact), and the text's true place by its four steps.

snap(aQ)lines 275–275exported
called by nothing in the registry
arcOf(k)lines 276–276
called by sinS
sinS(k)lines 278–284exported

sin and cos on the unit circle, exact rationals (Mādhava), of an angle in spandas.

cosS(k)lines 285–285exported
calls sinS
called by argS
argS(x, y)lines 287–297exported

the angle of (x, y), in whole spandas: the largest k with tan k ≤ y/x, by bisection in the first octant.

calls sinS, cosS, modB
called by bandhaGraha
jyaK(k)lines 300–306exported

Mādhava's jyā and koṭijyā (unit circle) of a whole-spanda angle: the quadrant taken in integers, the remainder by his series.

calls nothing in the registry
degToSp(d)lines 307–307
calls nothing in the registry
called by anglesAt, vectorB
radOfLat(deg)lines 308–308
calls nothing in the registry
called by vectorB
jyaR(x)lines 309–309
calls jyaK
called by vectorB
roundDivB(a, b)lines 334–334
calls nothing in the registry
called by anglesAt
coordB(body, c, ang)lines 353–367

one coordinate of a body: Σ over its lock-pulse terms (+ its secular polynomial, + its base angle for the longitude).

calls patra, jyaK
called by vectorB
sub3(a, b)lines 378–378
calls nothing in the registry
called by apparentB
dot3(a, b)lines 379–379
calls nothing in the registry
called by apparentB
dayQ(x)lines 381–381
qOf(x)lines 382–382
apparentB(key, tau)lines 385–401exported

the apparent geocentric direction of one graha at τ: light's time, the Sun's bending, the annual aberration (the owner's reduction).

BMk()lines 403–403
calls nothing in the registry
called by tauOf
tauOf(tQ)lines 406–406exported

the engine's civil day t → the record's own day (meridian.RECORD_OFFSET_Q, owner rule A: the record's epochs E are record days) → + the kāla-bīja

bandhaGraha(key, tQ)lines 408–418exported

one graha at civil t: Citrā-pakṣa longitude and latitude in whole spandas, distance (AU).

toDeg(k)lines 420–420
calls nothing in the registry

the nine on the bandha tier, with motion by difference over one day (SS 2.47–2.51: negative = vakra).

calls nothing in the registry
called by nothing in the registry
sunMoon(t)lines 450–450
limbIndex(lk, t)lines 451–451
limbEnd(name, tQ, spanDays = 2n)lines 453–458exported

the instant (civil Kali days, on the time lattice: whole spandas of the turn after t, D1c) at which a limb leaves its present index.

onTimeLattice(x)lines 460–460

a float civil day count → the nearest whole spanda of the turn, as civil days (the time lattice, D1c)

sunrise(tQ, place = UJJAYINI)lines 464–472exported

the sunrise of the civil day that contains t at a place, on the time lattice.

sunAt(x)lines 467–467
called by nothing in the registry
rise(d)lines 468–468
called by nothing in the registry

the five limbs at t for a place, each with the instant it ends.

called by nothing in the registry
idx(name)lines 478–478
calls limbIndex
called by bandhaPanchanga

civil time at a meridian ↔ Kali days from Laṅkā midnight, exact (Gregorian, the zone's offset in minutes east).

called by nothing in the registry
called by nothing in the registry
lokaOf(R)lines 527–532exported

the level of a lock of rate R (revolutions per kalpa): the largest unit its period P = kalpa/|R| reaches; R = 0 → 'axis'.

called by add

every lock of up to three wheels, |c| ≤ maxPair for two, ≤ maxTriple for three: { level → [{ terms, R, order }] } (lowest order first).

calls nothing in the registry
called by nothing in the registry
returnsPer(R)lines 551–551exported

returns of a lock in each unit above it (exact rationals): per kalpa it is R itself, a whole number.

called by nothing in the registry
bijaSeed()lines 568–604exported
called by nothing in the registry
pbar(even, odd)lines 570–570
calls nothing in the registry
called by bijaSeed
nOf(R)lines 571–571
calls nothing in the registry
called by bijaSeed
calls nothing in the registry
called by bijaSeed
fracQ(x)lines 626–626

── 13. The places through the lokas, top-down, on the day lattice N ─────────────────────────────────────────────────────── The text's own integers only. A wheel R (revolutions a kalpa) at civil day t (Laṅkā midnight at the Kali start = 0) is read from the top (SS 1.45–1.47: 452¾ mahāyugas gone at the Kali start): kalpa the 452 whole mahāyugas: R·452/1000 turns — nothing for a wheel whose R

called by lokaTurn
lokaTurn(wheel, tQ)lines 628–633exported

a wheel's place, read top-down: { kalpa, kali, within, turns } (exact rationals of a turn) and spandas (whole, of N).

cos30(k)lines 641–641exported
calls sin30
called by arg30
arg30(x, y)lines 642–652exported
calls sin30, cos30, modB
called by nothing in the registry
ARC(x)lines 658–658
spOfArcmin(a)lines 659–659
called by nothing in the registry
lokaGraha(key, tQ, opts = {})lines 661–661exported

one graha at civil day t by the text's steps: { spandas (whole, of N), arcmin (exact), steps }

calls nothing in the registry
called by sunMoon30
deg30(k)lines 676–676
calls nothing in the registry
called by lokaPanchanga

the nine through the lokas, with motion by difference over a day (negative = vakra).

calls nothing in the registry
called by nothing in the registry
sunMoon30(t)lines 694–694
limb30(name, t)lines 695–695
ayanamsha30(tQ)lines 701–705exported
calls lokaTurn
called by lokaPanchanga
sunrise30(tQ, place = UJJAYINI)lines 709–715exported

the sunrise of the civil day that contains t: the text's own rule (2.60-2.63, 3.42 — shastra-patha/panchanga.js on the 24 jyās, whose Sun is this tier's to the spanda), on the time lattice (whole spandas of the turn, D1c).

rise(day)lines 712–712
called by nothing in the registry
verify()lines 731–840exported

── verification: every identity, exactly ───────────────────────────────────

chk(id, ok, detail)lines 733–733
calls nothing in the registry
called by verify
fstr(n)lines 734–734
calls factor
called by verify