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

चन्द्रवाक्य, the Moon's vākyas regenerated from a canon's own numbers (slice 9 of the vedha-yantra engine).

345 lines · 0 exports

लेख · the header

The header, as the file states it

candravakya.js — चन्द्रवाक्य, the Moon's vākyas regenerated from a canon's own numbers (slice 9 of the vedha-yantra engine). THE METHOD. Start the count on a day when the mean Moon stands at its apogee (anomaly zero). After n civil days its true place has advanced by V(n) = m·n + manda-phala(kendra = −a·n) (mod 360°) where m is the Moon's mean daily motion, a its anomalistic daily motion (Moon − apogee), and the manda-phala is the canon's one equation: arc( R-sine(bhuja of the kendra) × epicycle ÷ 360 ), added while the kendra (apogee − Moon) is in its first half-circle and subtracted in the second (SS 2.29-2.45 [text]; the same form for Āryabhaṭa [reading]). V(1) … V(248) are the 248 vākyas: 248 days are nearly nine anomalistic months, so the anomaly — and with it the table — almost returns to its start [theorem from the canon, `closure`]. The tradition's 248-day cycle and its first vākyas 12°03′ (Vararuci, "gīrnaḥ śreyaḥ") and 12°02′35″ (Mādhava, "śīlaṃ rājñaḥ śriye"), and the longer cycles of 3031 and 12,372 days, are known here only as [snippet]s (design doc §8). Nothing in this file is fitted to them. THE CANONS (opts.canon): "aryabhata" (default) — Āryabhaṭīya, Gītikā 3: Moon 57,753,336 revolutions in 1,577,917,500 civil days [text, decoded in granthas.test.js and parahita-madhyama.test.js]; apogee 488,219 [certified only through Parameśvara's epoch, parahita-madhyama.js]. Mean places from parahita-madhyama.js. Epicycle 31.5/360 at both ends, the size the research attributes to Āryabhaṭa [unverified: not checked against a printed Āryabhaṭīya; design doc §8]; no local edition gives Āryabhaṭa's epicycles, so pass `epicycle` to replace it. "parahita" — the same integers with the Śakābda-saṃskāra and Parameśvara's 1/5 (Jyotirmīmāṃsā pp.11, 35 [text]): the places are parahitaArcsec, the daily rates are the integers less sakabdaRevPerYuga. Same epicycle [unverified]. "surya" — Sūrya-Siddhānta: 1,577,917,828 civil days (1.37), Moon 57,753,336, apogee 488,203 (1.33), 452¾ yugas gone at the Kali start (1.45-1.47); epicycle 32° at the even ends and 31°40′ at the odd, varying with the R-sine (2.34, 2.38) [text]. Its true Moon agrees with sphuta.js (tested). THE SINE (opts.sine): "table" = the Sūrya-Siddhānta's 24 R-sines on R = 3438 with linear interpolation (2.17-2.22, 2.31-2.33 [text]); "madhava" = Mādhava's sine polynomial on R = 3437′44″48‴, exact (spanda-ganita.js; every coefficient a Kaṭapayādi word decoded in katapayadi.test.js). Default: "madhava" for the two Kerala canons (the vākyas are Kerala and Mādhava wrote the seconds), "table" for "surya". Every step is exact rational arithmetic (BigInt); Mādhava's arc is the first arc-spanda (1/30,375,000′) whose sine reaches the value. THE WORDS. Each vākya, rounded to the second (Mādhava) or to the minute (Vararuci, opts.precision), is written as an integer — rāśi, then degrees, minutes (and seconds) as two digits each [reading: the [CV] words fix only the degree-minute(-second) layout of vākya 1, where the rāśi is 0; the place of the rāśi digit in later vākyas is not checked here] — and that integer is encoded with katapayadi.js encodeInteger, whose first syllable is the units digit: read अङ्कानां वामतो गतिः, as Mādhava's "śīlaṃ rājñaḥ śriye" = 120235 is. decodeWord gives it back exactly. THESE ARE NOT THE TRADITIONAL VĀKYAS. The authors chose meaningful Sanskrit sentences; this generator writes one valid digit-encoding per value (the first consonant of each varga row), which carries the number and nothing else. USE (vakyaMoon). A khaṇḍa is a whole day near anomaly zero; its dhruva is the canon's true Moon on that day. Days since the khaṇḍa are divided by the cycles (default 12,372, 3031, 248), each whole cycle adding its own dhruva — the true advance over that many days from the apogee, rounded like a vākya — and the remainder (< 248) picks the vākya. `compare` sets that beside the canon's true Moon computed directly: the difference is the method's own error [measured], from the khaṇḍa's leftover anomaly, the cycles' imperfect closure, and the rounding of the table. ("Dhruva" here is the tradition's word for a stored position at an epoch, not the pole of dhruva.js.) Day origin: whole civil days since the Kali epoch as the canon modules count them; whether the vākyas belong to sunrise (the Kerala reckoning [unverified]) or to that origin is left to the caller. No modern source, no imports beyond the sovereign files. Browser: window.Candravakya (needs Katapayadi, ParahitaMadhyama, Sphuta, SpandaGanita, KalaDvara); node: module.exports.
आवश्यक · requires

What it loads

required by
निर्यात · exports

What it exports

पाठ · the verses it cites

SS verses named in the header

  • SS 2.29verse
    grahaṃ saṃśodhya mandoccāttathā śīghrādviśodhya ca । śeṣaṃ kendrapadaṃ tasmādbhujajyā koṭireva ca ।।
नलिका · channels

The channels it runs in

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

Every function, what it calls, who calls it

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

neg(a)lines 58–58
calls nothing in the registry
modQ(a, m)lines 59–59
calls nothing in the registry
ratQ(x)lines 60–60
calls nothing in the registry
called by SAKA
toFloat(a)lines 61–61
calls nothing in the registry
bigInt(x, what)lines 62–66
calls nothing in the registry
ratOf(x)lines 68–77

A number of degrees (31.5), a [num, den] pair of BigInts, or a rational [n, d] → exact rational.

calls nothing in the registry
called by nothing in the registry
SAKA(b)lines 80–80

── the canons ────────────────────────────────────────────────────────────────────────────────────────────────────

calls ratQ
called by nothing in the registry
bhujaQ(k)lines 120–123

The bhuja (0…5400′) of an arc in arcminutes (SS 2.29-2.30).

calls nothing in the registry
called by mandaPhala
model(opts = {})lines 128–128exported

Resolve options → the model: rates in arcminutes per civil day (exact), the epicycle, the sine, the rounding.

calls nothing in the registry
mandaPhala(kendra, M)lines 159–164exported

The manda-phala in arcminutes, signed, for a kendra (apogee − Moon) in arcminutes (SS 2.29-2.45).

calls modQ, bhujaQ, neg
called by advance, trueMoon
advance(n, opts)lines 167–171exported

The true advance of the Moon after n civil days from the apogee, exact, in arcminutes [0, 21600).

called by vakya
roundArc(arcmin, precision)lines 175–179exported

Exact arcminutes → whole seconds (or minutes) of arc, rounded half up, on the circle.

calls nothing in the registry
called by vakya
split(units, precision, layout)lines 181–189exported

Whole units (seconds or minutes) → { rasi, deg (within the rāśi), amsa (total degrees), min, sec } and the integer.

calls nothing in the registry
called by vakya
pad(x)lines 190–190
calls nothing in the registry
called by dmsOf
dmsOf(s)lines 191–191
calls pad
called by vakya

Read a vākya word (the tradition's or this generator's) as a place: vāmato gatiḥ, then the layout.

calls nothing in the registry
called by nothing in the registry
vakya(n, opts)lines 208–218exported

One vākya: exact advance, rounded place, integer, word in both scripts, and the round trip.

called by nothing in the registry
generate(opts = {})lines 224–224exported

The table: day 0 (the cycle start, 0) and vākyas 1 … count (default 248). Cached per model.

calls nothing in the registry
called by nothing in the registry
describe(M)lines 234–240
calls toFloat
called by nothing in the registry
closure(N, opts)lines 245–258exported

How nearly N days close the anomaly, by the canon's own integers (exact): whole anomalistic months, and what is left over as an arc of anomaly and as days.

called by convergents
convergents(opts, count = 8)lines 260–273exported

Convergents p/q of the canon's anomalistic month in days (q months ≈ p days), from its continued fraction.

calls model, closure
called by nothing in the registry
trueMoon(kaliDay, opts)lines 277–286exported

The canon's true Moon on Kali day d, computed directly (exact arcminutes), with the mean places and the anomaly.

called by nothing in the registry
findKhanda(fromDay, toDay, opts)lines 288–299exported

The whole day in [fromDay, toDay] on which the mean anomaly is nearest zero: a khaṇḍa for the vākya count.

called by nothing in the registry
vakyaMoon(kaliDay, opts = {})lines 302–302exported

The Moon on Kali day d by the vākyas: the khaṇḍa's dhruva + whole cycles × their dhruvas + the vākya of the rest.

calls nothing in the registry
called by nothing in the registry
compare(kaliDay, opts = {})lines 331–331exported

The vākya way against the canon's own true Moon on the same day: the method's error, in arcminutes, signed.

calls nothing in the registry
called by nothing in the registry
kaliDayOf(date)lines 338–338exported

Civil date → Kali day (kala-dvara.js).

calls nothing in the registry
called by nothing in the registry