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

स्फुट, the true Sun and Moon of the Sūrya-Siddhānta, on its own wheel and with its own sine table.

211 lines · 0 exports

प्रमाण: पाठ SS ch. 1–2 (mean places, the sine table 2.17–22, 2.31–32, the manda and the Moon's latitude), 3.9–10 (the libration) · गणित · the default sine is the text's 24 jyās (owner, 2026-10-27); Mādhava's is withSine("madhava")
लेख · the header

The header, as the file states it

sphuta.js — स्फुट, the true Sun and Moon of the Sūrya-Siddhānta, on its own wheel and with its own sine table. प्रमाण: पाठ SS ch. 1–2 (mean places, the sine table 2.17–22, 2.31–32, the manda and the Moon's latitude), 3.9–10 (the libration) · गणित · the default sine is the text's 24 jyās (owner, 2026-10-27); Mādhava's is withSine("madhava") Mean places (madhyama) are exact residues on the SS wheel: revolutions R in a yuga of 1,577,917,828 civil days (SS 1.29-1.37), counted from midnight at Laṅkā at the start of the Kali-yuga, when 452¾ yugas of planetary motion had elapsed since creation (1.45-1.47: 1,953,720,000 years to the end of the Kṛta, + Tretā + Dvāpara = 1,955,880,000). So every place is frac(R × (1811/4 + days/1,577,917,828)), in BigInt; the Sun's apogee moves 387 revolutions in a kalpa of 1000 yugas (1.41), the Moon's 488,203 in a yuga, its node 232,238 backwards (1.33). TIME is the turn (owner D1/D1a/D1c, the pure turn clock): τ spandas of the star-wheel's turn since the Kali epoch, 30⁸ to a turn (SS 1.11-1.12). The wheel turns 1,582,237,828 times while 1,577,917,828 civil days pass (1.34, 1.37), so days/1,577,917,828 = τ/(1,582,237,828·30⁸) exactly and the place is frac(R × (1811/4 + τ/(1,582,237,828·30⁸))). A civil day enters only through spandasOfDays: days·30⁸·1,582,237,828/1,577,917,828 spandas, an exact rational {num, den} (never whole). True places (sphuṭa) follow ch.2 literally: 2.17-2.22 the 24 sines at 225′ steps on R = 3438 (decoded from the verses' numeral words in the test); 2.29-2.30 kendra = mandocca − planet; its bhuja and koṭi by quadrant; 2.31-2.33 interpolation, and the arc of a sine; 2.34-2.38 manda epicycle 14° (Sun) and 32° (Moon) at the even ends, 13°40′ and 31°40′ at the odd ends, varying with the bhuja; 2.39 manda equation = arc( bhujajyā × epicycle ÷ 360 ); 2.43 one manda operation for Sun and Moon; 2.45 added when the kendra is in Meṣa…Kanyā, subtracted from Tulā on; 2.57, 1.68 the Moon's latitude = sine(Moon − node) × 270′ ÷ R; 3.9-3.10 ayanāṃśa: 600 librations a yuga; three-tenths of the bhuja of that arc, in degrees. Only this tier's arithmetic is reproduced here; the Moon has the text's single equation and no second one. That is the text's Moon, not the sky's: its distance from the sky is what the owner's vedha will measure. No imports. The sine (owner's decision, 2026-10-27, the formulary: "align 100% with this Shastra"): by default the text's 24-entry table with linear interpolation, as written (2.17-2.22, 2.31-2.32); Mādhava's sine carried to R = 3438 (the sine to 6e-5 of an R-unit) is withSine("madhava") — the 24 numbers themselves (JYA) are the same in both. (2026-10-07 to 2026-10-27 the default was Mādhava's.) Against the ancestors' 15 recorded eclipses the two give the same verdict on every one (ss-madhava.test.js). `sineSlope` is 2.48's tabular difference ÷ 225 with the table, the polynomial's derivative with Mādhava's. Browser: window.Sphuta; 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.29verse
    yuge sūryajñaśukrāṇāṃ khacatuṣkaradārṇavāḥ । kujārkiguruśīghrāṇāṃ bhagaṇāḥ pūrvayāyinām ।।
  • 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ā ।।
नलिका · channels

The channels it runs in

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

Every function, what it calls, who calls it

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

big(x)lines 55–55
calls nothing in the registry
called by build, tq
mod(a, m)lines 56–56
calls nothing in the registry
floorDiv(a, b)lines 57–57
calls nothing in the registry
gcd(a, b)lines 58–58
calls nothing in the registry
called by build, exact
exact(num, den)lines 60–60

num/den in lowest terms: a BigInt when it is whole, else { num, den }.

calls gcd
called by build, spandasOfDays
tq(T)lines 62–62

A time in spandas of the turn as {num, den}: a BigInt (a whole number of spandas) or an exact rational {num, den}.

spandasOfDays(days)lines 66–70exported

Spandas of the turn since the Kali epoch (midnight at Laṅkā) of a civil day count: exact for a whole number of days (BigInt or integer) — a BigInt when whole, else {num, den} in lowest terms; a fractional day count (a float) is put on the turn lattice, the nearest whole spanda (a BigInt).

called by build, sphutaAtDays
daysOfSpandas(T)lines 72–75exported

Spandas of the turn (BigInt or {num, den}) → civil days (float; the whole part exact): τ·S/(N·R).

calls tq, floorDiv
called by build

Fraction of a revolution of a body moving R revolutions per yuga (×perYugaDen) at τ spandas of the turn, exact: frac(R·(1811/4 + τ/(RISINGS·SPT))) as {num, den}, 0 ≤ num < den.

calls tq, mod
toDeg({ num, den })lines 84–84
calls nothing in the registry
madhyama(S)lines 87–96exported

Mean places in degrees (sidereal, from the text's Meṣa 0) at τ spandas of the turn since the Kali epoch.

called by build, sphuta
tableJya(m)lines 100–103

2.31-2.32: R-sine of an arc of 0…5400 minutes by the table and linear interpolation.

calls nothing in the registry
called by build, jyaOfArcmin
tableArc(x)lines 105–109

2.33: arc in minutes of an R-sine 0…3438.

calls nothing in the registry
tableSlope(m)lines 111–111

2.48: the sine's rate (R-sine per minute) at an arc: the tabular difference of its 225′ step ÷ 225.

calls nothing in the registry
called by build, sineSlope
madhavaJya(m)lines 122–125
calls nothing in the registry
madhavaSlope(m)lines 126–129
calls nothing in the registry
jyaOfArcmin(m)lines 148–151exported

R-sine of an arc of 0…5400 minutes: the table (2.31-2.32), or Mādhava's on R = 3438.

called by build, jya
arcminOfJya(x)lines 153–156exported

The arc in minutes of an R-sine 0…3438 (2.33).

sineSlope(m)lines 158–158exported

The sine's rate at an arc of 0…5400 minutes (R-sine per minute): 2.48's tabular step, or the polynomial's derivative.

called by build
bhuja(deg)lines 160–166exported

2.29-2.30: the bhuja of an arc (degrees) and the sign of its sine.

calls mod
called by build, jya, ayanamshaSS
jya(deg)lines 168–168exported

Signed R-sine of any arc in degrees, by the table.

mandaPhala(mean, mandocca, pair)lines 171–178exported

2.29-2.45: the manda equation in degrees for a mean place and its mandocca, with the text's epicycle pair.

called by build, sphuta
sphuta(S)lines 181–189exported

True Sun, true Moon, the node, the Moon's latitude, and the mean places, at τ spandas of the turn since the Kali epoch.

SS 3.9-3.10 at τ spandas of the turn: 600 librations a yuga, three-tenths of the bhuja (±27°). phaseDeg and amplitudeDeltaDeg (both 0 = the text) move the libration's phase and its greatest value (27° + δ): the paramparā's three determinations (Āryabhaṭa's zero in Kali 3600, Nīlakaṇṭha's 14°26′, Parameśvara's 15°) are applied this way by ss-tier.js through the saṃskāra record; nothing else changes

called by build