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

ग्रह: the five star-planets of the Sūrya-Siddhānta — mean places, the four-step true place, true daily

475 lines · 0 exports

लेख · the header

The header, as the file states it

ss-graha.js — ग्रह: the five star-planets of the Sūrya-Siddhānta — mean places, the four-step true place, true daily motion, stations and retrogression, latitudes, and the conjunctions of chapter 7 — by the text's own arithmetic: its revolution numbers, its epicycles, and its 24-entry sine table on R = 3438 with linear interpolation (sphuta.js). 1.29-1.32 revolutions in a yuga (eastward): Mars 2,296,832; Jupiter 364,220; Saturn 146,568; Mercury's śīghra 17,937,060; Venus's śīghra 7,022,376; and 4,320,000 for "sūrya-jña-śukrāṇām" and for "kuja-ārki-guru- śīghrāṇām" — the mean Mercury and Venus are the mean Sun, and the mean Sun is the śīghrocca of Mars, Jupiter and Saturn. 1.41-1.44 per kalpa (1000 yugas, 1.40): mandoccas eastward ("prāggateḥ") Mars 204, Mercury 368, Jupiter 900, Venus 535, Saturn 39; nodes westward ("pātānām atha vāmataḥ") Mars 214, Mercury 488, Jupiter 174, Venus 903, Saturn 662. 1.45-1.47 1,953,720,000 years from creation to the end of the Kṛta; + Tretā + Dvāpara = 1,955,880,000 at the Kali epoch, which is 452¾ yugas: a yuga body is frac(R·(1811/4 + days/1,577,917,828)), exact in BigInt. 1.53-1.54 mean place = days × revolutions ÷ civil days; uccas forward; nodes the same way, taken from the circle. 1.55 Jupiter's revolutions gone × 12, with the (current) signs, cleared of sixties: the years "from Vijaya" — the sixty-year cycle from mean Jupiter since creation, exact in BigInt (samvatsara) [reading A: signs gone, remainder 0 = Vijaya; reading B: remainder 1 = Vijaya]. The text names only Vijaya; the other 59 names are the standard list [standard]. 1.57-1.58 at the end of the Kṛta every mean planet is at Meṣa 0 (and at the Kali epoch too, since 4 divides every R). 1.68-1.70 greatest latitudes "trighana-randhra-arka-rasa-arka-arka, daśa-hatāḥ", Moon onward in weekday order: Moon 270′, Mars 90′, Mercury 120′, Jupiter 60′, Venus 120′, Saturn 120′ (1.69: 270′ ÷ 9 = 30′; ×2 Jupiter, ×3 Mars, ×4 Mercury, Venus, Saturn). 2.29-2.30 kendra = ucca − planet ("grahaṃ saṃśodhya mandoccāt tathā śīghrāt"); bhuja and koṭi by quadrant. 2.34-2.38 epicycles at the even ends (kendra 0°, 180°) and the odd ends (90°, 270°): manda 75/72, 30/28, 33/32, 12/11, 49/48; śīghra 235/232, 133/132, 70/72, 262/260, 39/40 (Mars, Mercury, Jupiter, Venus, Saturn); between the ends the epicycle moves from the even value toward the odd by the bhujajyā ÷ R (2.38). 2.39 manda equation = arc(bhujajyā × epicycle ÷ 360). Its koṭiphala gives a manda karṇa, used only in 7.14. 2.40-2.42 śīghra: koṭiphala = koṭijyā × epicycle ÷ 360, added to R from Makara (kendra 270°…90°), taken from R from Karka; karṇa = √((R ± koṭiphala)² + bhujaphala²); equation = arc(bhujaphala × R ÷ karṇa). 2.43-2.44 for Mars and the others, four operations: half the śīghra equation on the mean planet; half the manda equation (from that place) on it; the full manda equation (from that place) on the MEAN planet; the full śīghra equation (from that place) on it. The text names no other order for Mercury and Venus: "bhaumādīnām". 2.45 both equations are added when the kendra is in Meṣa…Kanyā, subtracted from Tulā on. 2.46 bhujāntara: motion × the Sun's equation ÷ 21,600, applied as the Sun's — here a time-shift of every mean place by the Sun's equation (minutes ÷ 21,600 of a day); optional, off by default as in sphuta.js [reading]. 2.47-2.49 manda motion: the kendra's motion × tabular sine-difference ÷ 225 × epicycle ÷ 360, added from Karka, subtracted from Makara. 2.50-2.51 true motion: (śīghrocca's motion − manda motion) × (karṇa − R) ÷ karṇa, added to the manda motion when the karṇa exceeds R, subtracted when less; when the subtraction exceeds the motion, the remainder is retrograde. 2.53-2.55 the texts' station kendras 164, 144, 130, 163 (guṇāṣṭibhiḥ, aṣṭi = 16; D15 — e-text guṇāṣṭabhiḥ = 83 is a variant), 115; retrogression ends at 360° − κ; the planet then stands in the 7th, 8th, 8th, 7th, 9th sign from its śīghrocca. These are compared, not imposed. 2.56-2.57 the node of Mars, Jupiter, Saturn takes the (final) śīghra equation as the planet does; of Mercury and Venus the third (manda) equation, reversed ("vāmam"); latitude = jyā(planet − node′) — for Mercury and Venus jyā(śīghrocca − node′) — × greatest latitude ÷ the last (śīghra) karṇa. 7.1-7.6 conjunction of two planets: which is past and which to come (7.2-7.3); the longitude difference over the difference of the daily motions, or over their sum when one is retrograde (7.4); added or subtracted (7.5); repeated until the minutes are equal (7.6), as 4.8 repeats the syzygy [reading: 7.6 states one step]; where two slow planets near a station keep it from settling (~2% of cases), the bracket is halved instead. 7.7-7.10 dṛkkarma at an hour angle: ākṣa = latitude′ × palabhā ÷ 12 × nata ÷ own half-day (7.8, read "viṣuvacchāyayābhyastād" for the damaged "…chāyayāmyastad"); northern latitude east −, west +, southern the reverse (7.9, read "kṣayaḥ" for the damaged "kṣamaḥ"); āyana = latitude′ × declination° of (λ + 90°), in seconds, + when unlike, − when alike (7.10). 7.12 the two latitudes at that instant: alike, their difference; unlike, their sum — the separation. 7.13-7.14 diameters on the Moon's orbit, "thirty increased by half of half": Mars 30, Saturn 37½, Mercury 45, Jupiter 52½ yojanas, Venus 60; × 2R ÷ (third karṇa + fourth karṇa) = the corrected diameters, ÷ 15 = minutes. The word "svakarṇāḥ" is nominative, describing those corrected diameters, not a second division [reading]. 7.18-7.23 at the conjunction: discs touching — ullekha, overlapping — bheda; under a degree — yuddha (apasavya when one is faint); over a degree — samāgama when both are bright; the northern one wins, Venus mostly wins. Floats on the text's table (the mean places are exact residues in BigInt, then floated); no spherical trigonometry; the only root taken is 2.41's "mūlam". Every longitude is sidereal from the text's Meṣa 0°; the ayanāṃśa (3.9-3.10) enters only where the text needs a declination (7.8-7.10). How close this is to the sky is for the owner's vedha. withSine("madhava"): the same with Mādhava's sine (sphuta.js, on R = 3438) in place of the table; measured in ss-madhava.test.js. The default is the text's table. Browser: window.SSGraha (needs Sphuta, SSUdaya); 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

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

tq(T)lines 72–72
calls nothing in the registry
planetOf(name)lines 90–90
calls nothing in the registry
fracDeg(num, den)lines 92–92
calls nothing in the registry
called by yugaDeg, kalpaDeg
yugaDeg(rev, Sp)lines 96–99exported

Degrees of a body with `rev` revolutions a yuga, at τ spandas of the turn since the Kali epoch (days/YUGA = τ/(RISINGS·SPT)).

calls tq, fracDeg, mod
called by meanPlaces
kalpaDeg(rev, Sp, westward)lines 101–105exported

Degrees of a body with `rev` revolutions a kalpa (1.41-1.44), counted from creation (1,955,880,000 years at Kali).

calls tq, fracDeg, mod
called by meanPlaces
perDay(rev)lines 107–107

Mean daily motions in minutes a civil day.

calls nothing in the registry
called by motions, moonState
perDayKalpa(rev)lines 108–108
calls nothing in the registry
called by motions
motions(name)lines 109–117exported
meanPlaces(days)lines 120–127exported

Mean places in degrees at `days` (civil days since midnight at Laṅkā at the Kali epoch; a number or BigInt).

paridhiAt(kendra, pair)lines 131–131exported

2.38: the epicycle at a kendra, from its even-end and odd-end values.

calls nothing in the registry
called by manda, sighra
kotiJya(kendra)lines 133–133

Signed koṭijyā of a kendra (2.30), + from Makara (270°…90°), − from Karka (2.40).

calls mod
called by manda, sighra
manda(kendra, pair)lines 135–140exported

2.39 (+ 2.45): the manda equation in degrees for a kendra (ucca − planet), with its karṇa (used by 7.14 only).

called by fourSteps
sighra(kendra, pair)lines 142–148exported

2.38-2.42 (+ 2.45): the śīghra equation in degrees for a kendra (śīghrocca − planet), with its karṇa.

called by fourSteps
fourSteps(name, m, opts)lines 154–176exported

2.43-2.44, 2.56-2.57: the four operations for one planet from its mean places m (one entry of meanPlaces). opts.asakrt (owner, 2026-10-28; the text's own "asakṛt" of 3.20, 5.9, 11.11 — "yāvat sarvaṃ sthirībhavet"): the steps again and again, the first step's śīghra taken from the last manda-true place instead of the mean, until that place stops moving. The first pass is the text's four steps exact

sunEquation(days)lines 179–179exported

The Sun's equation (degrees) at `days`, for 2.46.

calls nothing in the registry
called by instantOf
instantOf(days, opts)lines 181–181

2.46: the instant the planet's places are taken at — `days`, or shifted by the Sun's equation (bhujāntara).

truePlace(days, name, opts)lines 184–187exported

The true place of one planet: longitude (deg, sidereal), latitude (arcmin, north +), and every step.

truePlaces(days, opts)lines 189–193exported

True places of all five at `days`: { mars: {longitude, latitude, …}, … }.

dorjyantara(kendra)lines 198–200exported

2.48: the tabular sine-difference of the 225′ step holding the bhuja of a kendra (with Mādhava's sine, 225 × its derivative there).

calls nothing in the registry
called by mandaMotion

2.47-2.49: the manda-corrected motion from a mean motion `n` (minutes a day), the kendra's motion `nk`, a kendra and its epicycle: n ± |nk| × difference ÷ 225 × epicycle ÷ 360, + from Karka, − from Makara.

trueMotion(days, name, opts)lines 209–216exported

2.47-2.51: true daily motion of a planet at `days`, minutes a day; negative = retrograde (vakra).

placeMotion(days, name, h)lines 218–221exported

The motion of the four-step place itself (central difference over ±h days), minutes a day [measured].

called by speedOf
speedOf(t, name, by)lines 225–225

Sign of the speed at t, by the text's rule (default) or by the place's own motion ({ by: "place" }).

houseFromSighrocca(kappa)lines 227–227exported

2.55: the sign counted from the śīghrocca in which a planet of śīghra-kendra κ stands: (360° − κ) ÷ 30, + 1.

calls mod
stations(name, t1, t2, opts)lines 234–257exported

Stations between t1 and t2 (days): { t, kind: "vakra" (turns retrograde) | "margi" (turns direct), kendra (2.53's "caturtheṣu kendrāṃśaiḥ": the fourth operation's śīghra kendra), house (2.55), longitude }. `by`: "place" (the four-step place's own motion, default: its turning points fall in 2.55's signs for all five) or "text" (the motion rule of 2.47-2.51, whose zero comes several degrees earlier

Retrograde spans between t1 and t2: from each "vakra" station to the next "margi" — start, end, days, the kendra at each end (2.53-2.54), the arc of longitude gone backwards, the houses (2.55). Spans cut by t1 or t2 are marked open.

called by nothing in the registry
synodicDays(name)lines 281–281exported

Synodic period in days from the revolution numbers alone: a yuga ÷ |śīghrocca revolutions − planet's|.

calls planetOf
called by nothing in the registry
moonState(days)lines 284–288exported

── the Moon, for 7.23 (sphuta.js's place; its motion by 2.47-2.49) ──────────────────────────────────────────

called by bodyState
bodyState(days, name)lines 290–294exported

Longitude (deg), latitude (arcmin) and true motion (arcmin/day) of a body: a planet or "moon".

yutiInterval(lamA, vA, lamB, vB)lines 299–315exported

7.2-7.5 literally: two longitudes (deg) and daily motions (arcmin/day, negative = retrograde). Returns the days to the conjunction (negative when it is past), whether it is past, and the divisor used ("difference" | "sum").

calls wrap180, mod
called by yutiNear, yutiDrk
yutiNear(a, b, t0, bracket)lines 319–340exported

The conjunction in longitude of bodies a and b near `t0`: 7.2-7.6 repeated until the step is under 1e-7 day. With a bracket [lo, hi] holding one change of sign of the longitude difference, a run of 7.4 that fails to settle inside it (two slow planets near a station, whose motions nearly match) is replaced by halving the bracket: `method` says which.

conjunctions(t1, t2, opts)lines 342–358exported

Every conjunction in longitude between t1 and t2 among `bodies` (default the five; add "moon" for 7.23).

called by nothing in the registry
diameter(name, place)lines 362–366exported

7.13-7.14: the apparent diameter in minutes: viṣkambha × 2R ÷ (manda karṇa + śīghra karṇa) ÷ 15.

calls planetOf
called by yuddha
yuddha(c)lines 368–380exported

7.18-7.23: what the text calls a conjunction of two star-planets, from its separation (7.12) and discs (7.14).

calls diameter
called by nothing in the registry

Cara (asus) of a declination given by its signed R-sine, at a palabhā (2.61-2.62).

calls nothing in the registry
called by drkkarma

7.8-7.10: the dṛkkarma of a body at sidereal λ (deg) with latitude (arcmin, north +), at a place of palabhā, at hour angle `hourAngleAsus` (west +), with the ayanāṃśa (deg) for the declinations. The half-day is the body's own, from its true declination (2.58: latitude added when alike). Returns the corrected sidereal λ and the parts.

called by yutiDrk
meridianAsus(days, desantaraDays)lines 405–410exported

The meridian's Laṅkā-ascension (asus) at `days` for a place `desantaraDays` east of the prime meridian: the true Sun's ascension + its hour angle, taking the day count as reckoned from midnight and the true Sun lagging the mean by its equation [reading; no obliquity term, as in the text].

calls mod
called by yutiDrk
yutiDrk(c, site)lines 413–421exported

7.7-7.12: the conjunction c (from conjunctions/yutiNear) as seen at a place { palabha, desantaraDays }: each body's dṛkkarma at its own hour angle, one 7.4 step to equal corrected longitudes, and the latitudes at that instant.

called by nothing in the registry
floorDiv(a, b)lines 434–434
calls nothing in the registry
jupiterRevolutions(Sp)lines 437–437

Mean Jupiter's revolutions since creation at τ spandas of the turn since the Kali epoch, as the exact fraction num/den: 364,220 × (1,955,880,000 years + τ of time) ÷ (4,320,000 years of a yuga) (1.45-1.47, 1.53).

calls tq
samvatsara(days, opts = {})lines 443–443exported

SS 1.55: "dvādaśaghnā guroryātā bhagaṇā vartamānakaiḥ rāśibhiḥ sahitāḥ śuddhāḥ ṣaṣṭyā syurvijayādayaḥ" — Jupiter's revolutions gone × 12, with the signs, cleared of sixties: the years from Vijaya. Exact (BigInt) from mean Jupiter since creation (1.45-1.47). Reading "A" (default, opts.zero 0) [reading]: the signs gone in the current revolution are added, and remainder 0 is Vijaya, the current year

calls nothing in the registry
called by nothing in the registry
samvatsaraChangeAfter(days)lines 459–467exported

The next instant after `days` at which mean Jupiter enters a sign — where the 1.55 name changes — in civil days since the Kali epoch; closed form, the changes falling 1,577,917,828 ÷ (364,220 × 12) = 361.0267 days apart [theorem].

called by nothing in the registry