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

अहर्गण and the lords: the Sūrya-Siddhānta's own day-count from a lunisolar date, and the lords of

199 lines · 0 exports

लेख · the header

The header, as the file states it

ss-ahargana.js — अहर्गण and the lords: the Sūrya-Siddhānta's own day-count from a lunisolar date, and the lords of the day, month, year and horā, by the text's integers. 1.45-1.47 from creation to the end of the Kṛta 1,953,720,000 years; to the Kali epoch 452¾ yugas of motion, 1,955,880,000 years = 714,402,296,627 civil days (452¾ × 1,577,917,828) [theorem]. 1.48 the years gone (gatakālābda) × 12, plus the months gone since Madhu-śukla (Caitra śukla), "kept apart". 1.49 those months × the yuga's adhimāsas ÷ its solar months = adhimāsas gone (the quotient); add them, make days (× 30) and add the tithis gone. 1.50 those days, "kept in two places", × the yuga's kṣaya-days ÷ its lunar days = kṣaya gone; subtract: the civil day-count at midnight at Laṅkā (ārdharātrika). 1.51 ÷ 7: the remainder from the Sun (Sunday = 0) is the lord of the day. 1.52 the count ÷ 30 and ÷ 360 (months and years of civil days) × 2 and × 3, + 1 (rūpa), ÷ 7: the remainders, counted from the Sun as 1, are the lords of the month and the year. 12.78-79 the orbit order downward from Saturn: Saturn, Jupiter, Mars, Sun, Venus, Mercury, Moon. Day lords are every fourth, year lords every third, from Saturn down; month lords run upward from the Moon; horā lords downward from Saturn, one a horā. Theorems tested: creation (Sunday, 1.51) + 714,402,296,627 days falls on a Friday — the Kali epoch's weekday; 12.78's "every fourth" is +1 weekday (24 horās ≡ 3 orbit steps), "every third" is +3 (360 ≡ 3 mod 7), 12.79's "upward from the Moon" is +2 (30 ≡ 2 mod 7): the two chapters give the same lords. The yuga numbers are the text's (1.29-1.39, corpus/surya-siddhanta/numbers.json); kala-dvara.js gives the same. The lunisolar year (yearOfKali, lunarYear): from the nija Caitra new moon to the next, by the true calendar (panchanga.js, passed in) — amānta months named by their saṅkrāntis (14.10; the naming rule is standard practice, no local text), Kali years gone at the start, Śaka = Kali − 3179 and Vikrama = Kali − 3044 [standard]; which Caitra opens the year when there are two is [unverified convention]. The 100,000-year calendar (scripts/calendar-100k.cjs) is built on yearOfKali. Browser: window.SSAhargana (needs KalaDvara); node: module.exports.
आवश्यक · requires

What it loads

required by
निर्यात · exports

What it exports

पाठ · the verses it cites

SS verses named in the header

none in the registry

नलिका · channels

The channels it runs in

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

Every function, what it calls, who calls it

18 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 44–44
calls nothing in the registry
mod(a, m)lines 45–45
calls nothing in the registry

1.48-1.50: the civil days since creation, at midnight at Laṅkā, from the years gone since creation, the lunar months gone since Caitra śukla, and the tithis gone in the current month. Every division keeps the quotient ("labdha").

calls nothing in the registry

The text's count is a mean count: the tithis are true, the kṣaya and adhimāsa quotients mean. A reckoner checks it by the weekday (1.51 read backwards) [reading: the standard practice; the text gives the lord, not the check]: the day within ±span of the count, `monthShift` months on (−1 when the mean adhimāsa of 1.49 has already counted the year's adhika month and the true one is still to come), w

calls nothing in the registry
called by nothing in the registry
aharganaFromKali(o)lines 68–68exported

The same from Kali years gone (years since the Kali epoch).

calls ahargana, big
called by exactDay
exactDay(date, P)lines 76–95exported

The exact civil day (Kali day number) of a lunisolar date, by the true calendar `P` (panchanga.js, passed in): the day at whose start (midnight at Laṅkā, as 1.50 counts) the given true month (name, adhika or not) and tithi are current, in the year whose nija Caitra began `kaliYearsGone` years after the Kali epoch. The text's count (1.48-1.50) is the first guess; its own offsets (0, ±1, a month eit

called by nothing in the registry
lords(daysSinceCreation)lines 98–105exported

1.51-1.52: the lords from a day-count since creation (BigInt or number).

calls big, mod
called by lordsOfKaliDay
lordsOfKaliDay(N)lines 107–107exported

The lords for a day counted from the Kali epoch (kala-dvara's day numbers).

calls lords, big
called by nothing in the registry
orbitIndex(name)lines 110–110

12.78-79 sequences, each as the next lord's step from the current one.

calls nothing in the registry
nextDayLord(name)lines 111–111exported
called by nothing in the registry
nextYearLord(name)lines 112–112exported
called by nothing in the registry
nextMonthLord(name)lines 113–113exported
called by nothing in the registry
horaLord(dayLord, h)lines 115–115exported

12.79: the lord of horā h (0 = the first, at sunrise) of a day whose lord is `dayLord`: downward one a horā.

called by nothing in the registry

The horā running at t (days since the Kali epoch) on civil day N, given that day's sunrise and the next: equal horās of the ahorātra (24 from sunrise) [reading — the text does not say equal or unequal], or "unequal": twelve of the day and twelve of the night (needs opts.sunset) [unverified].

calls nothing in the registry
called by nothing in the registry
needCalendar(P)lines 133–135
calls nothing in the registry
called by yearOfKali
caitraStart(k, P)lines 138–145

The Meṣa saṅkrānti nearest the mean one of Kali year k (k mean years after the epoch, 14.10) and the new moon before it: the start of the month that holds it, Caitra.

calls nothing in the registry
called by yearOfKali
yearOfKali(k, P)lines 154–184exported

The lunisolar year whose nija Caitra begins k Kali years gone (k = Kali years gone at the year's start), by the true calendar P (panchanga.js, passed in, as exactDay takes it): { k, shakaGone, vikramaGone, start, end, mesha, yearStartRule, months, sankrantis }. Months are amānta, new moon to new moon, each named by P.nameMonth from the saṅkrāntis inside it (adhika, kṣaya); a 13th month is an adhik

lunarYear(t, P)lines 186–194exported

The year of yearOfKali that holds the instant t (start ≤ t < end).

called by nothing in the registry