yantra/patha/spanda-ganita.js
स्पन्द-गणित: the Sūrya-Siddhānta's Sun and Moon, and every limb of the pañcāṅga, EXACT on the
250 lines · 0 exports
The header, as the file states it
What it loads
What it exports
SS verses named in the header
- SS 1.11verseprāṇādiḥ kathito mūrtastruṭyādyo amūrtasaṃjñakaḥ । ṣaḍbhiḥ prāṇairvināḍī syāttatṣaṣṭyā nāḍikā smṛtā ।।
- SS 4.7versetulyau rāśyādibhiḥ syātāṃ amāvāsyāntakālikau । sūryendū paurṇamāsyante bhārdhe bhāgādikau samau ।।
- SS 2.47versesvamandabhuktisaṃśuddhā madhyabhuktirniśāpateḥ । dorjyāntarādikaṃ kṛtvā bhuktāvṛṇadhanaṃ bhavet ।।
The channels it runs in
Every function, what it calls, who calls it
34 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.
── exact rationals [n, d], d > 0 ─────────────────────────────────────────────────────────────
frac(R·(1811/4 + τ/(RISINGS·SPT))) × 21600, exact.
The Sun's apogee: 387 turns in a kalpa (1.41), with 1,955,880,000 years gone at the Kali epoch (1.47).
2.31-2.32: R-sine of an arc of 0…5400′.
2.33: arc in minutes of an R-sine 0…3438.
Rsin of an arc m (arcminutes, rational, 0…5400) by Mādhava's polynomial; returned unreduced (num, den > 0).
The bhuja (0…5400′) of an arc in arcminutes, 2.29-2.30.
2.29-2.45 for the Sun or Moon: the manda equation in arcminutes, signed.
True Sun and Moon (arcminutes, exact) at τ spandas of the turn.
Arc in arcminutes → arc-spandas (exact rational).
Every limb at τ, as integer cells of N (1-based).
Signed distance (arcminutes) of a limb's argument past the edge `edge` (arcminutes), in (−10800, 10800].
The FIRST spanda of the turn at which the limb's argument reaches `edge`, given lo before it and hi after.
Turn-spandas from civil days since the Kali epoch (a float: the whole days exact, the fraction to the nearest spanda), and back (exact rational of days).
Split a turn-spanda count: whole turns since the epoch, then the pāda of the turn (1…108, 200 prāṇas each) and ghaṭī / vināḍī / prāṇa / spanda within the turn.
End of the tithi `index` (1…30) nearest civil day `nearDays`: the first spanda of the turn at which it ends.
SS 2.47-2.49: true motions of the Sun and Moon, in arcminutes per turn of the star-wheel. The kendra's motion × the tabular sine-difference of its step (bhogya-khaṇḍa) ÷ 225 × the epicycle ÷ 360, added from Karka (kendra 90°…270°), subtracted from Makara. With the Mādhava sine the slope is the polynomial's own derivative.
SS 4.8: from a first estimate, correct the time by the remaining elongation over the rate of elongation, again and again, until the correction is under a spanda; then the integer spanda reached. The rate is the elongation gained over the next turn (default) or the text's true motions of 2.47-2.49 ({ rate: "text" }).