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

छाया: the Sūrya-Siddhānta's shadow chain (chapter 3, tripraśna — direction, place and time) by the text's

548 lines · 0 exports

प्रमाण: पाठ SS ch. 3 (the shadow, the gnomon, the cara) · गणित
लेख · the header

The header, as the file states it

ss-chaya.js — छाया: the Sūrya-Siddhānta's shadow chain (chapter 3, tripraśna — direction, place and time) by the text's प्रमाण: पाठ SS ch. 3 (the shadow, the gnomon, the cara) · गणित own arithmetic — the 24 sines on R = 3438 with linear interpolation (2.17-2.22), the versed sines that are those sines read backwards (2.23-2.27), the greatest declination's sine 1397 (2.28) — and the vedha record that reduces the owner's own shadows. No spherical trigonometry: every arc comes from the table, every root is the text's mūla or pada. 3.1-3.4 a levelled slab, a circle, the gnomon at its centre; the tips of the forenoon and afternoon shadows on the circle are west and east; the fish-figure gives north-south, then east-west and the corners. `pracyaparaSkew`: how far that line is turned when the declination moves between the two marks. 3.5-3.7 the shadow is read in aṅgulas; an east-west line through the tip of the equinoctial shadow; a shadow tip's distance from that line is the agrā. 3.8 karṇa = √(śaṅku² + chāyā²); chāyā = √(karṇa² − śaṅku²); the śaṅku by the reverse. 3.11-3.12a the true Sun agrees with sight at the solstice and the two equinoxes; when the computed Sun (karaṇāgata) is less than the shadow-Sun (chāyārka) the circle has moved east by the difference; west when it is more. 3.12b-3.14a the equinoctial noon shadow, on the north-south line, is the palabhā; R × śaṅku and R × palabhā ÷ the equinoctial hypotenuse are the lambajyā and the akṣajyā; their arcs, co-latitude and latitude, "always south". 3.14b-3.15a noon: R × the shadow ÷ its own hypotenuse, as an arc, is the nata — north when the shadow is south, south when it is north ("dakṣiṇe bhuje uttarāḥ, uttare yāmyāḥ"). 3.15b-3.16a nata and the Sun's declination, added when unlike, differenced when alike, are the latitude. 3.16b-3.17a akṣajyā from the latitude; lambajyā = √(R² − akṣajyā²); palabhā = 12 × akṣajyā ÷ lambajyā. 3.17b-3.18a latitude and nata, the difference when alike, the sum when unlike: the declination; its sine × R ÷ 1397, 3.18b-3.19 as an arc, is the Sun from Meṣa; from Karka take it from 180°, from Tulā add 180°, from Makara take it from 360°: the true (sāyana) Sun at noon. The quadrant is the observer's to know (the season), not the shadow's. 3.20a its manda equation applied in reverse, again and again ("asakṛd vāmam"): the mean Sun. 3.20b-3.22a latitude and declination, the sum when alike, the difference otherwise: the noon nata; its sine and cosine (koṭijyā) give the noon shadow 12 × sine ÷ koṭijyā and hypotenuse 12 × R ÷ koṭijyā. 3.22b-3.25a the Sun's agrā = krāntijyā × the equinoctial hypotenuse ÷ the śaṅku-sine; × any hypotenuse ÷ the noon one is that shadow's own; with the palabhā it gives the bhuja, the tip's distance from the east-west line; at noon the bhuja is the shadow. 3.25b-3.27a on the prime vertical: lambajyā × palabhā ÷ krāntijyā = akṣajyā × 12 ÷ krāntijyā is the hypotenuse; when the declination is north and less than the latitude, so is the noon hypotenuse × palabhā ÷ the noon agrā. 3.27b-3.28a agrājyā = krāntijyā × R ÷ lambajyā; × a hypotenuse ÷ R is the agrā in aṅgulas. 3.28b-3.34a the corner gnomon: karaṇī = (R²/2 − agrājyā²) × 12 × 12 ÷ (palabhā² + 12²/2); phala = 12 × palabhā × agrājyā ÷ the same; śaṅku = √(phala² + karaṇī) ∓ phala (south, north); dṛgjyā = √(R² − śaṅku²); shadow and hypotenuse = 12 × dṛgjyā and 12 × R, each ÷ the śaṅku. 3.34b-3.36 any hour: antyā = R + carajyā for a northern declination, R − carajyā for a southern one (NOT √(R² − krāntijyā²)); cheda = (antyā − utkramajyā of the nata) × dyujyā ÷ R; śaṅku = cheda × lambajyā ÷ R; shadow as before. 3.37-3.39 the reverse: dṛgjyā = R × shadow ÷ hypotenuse; śaṅku = √(R² − dṛgjyā²); cheda = śaṅku × R ÷ lambajyā; unnatajyā = cheda × R ÷ dyujyā; antyā − unnatajyā is a versed sine whose arc is the nata in asus. 3.40-3.41a any shadow: krāntijyā = lambajyā × agrā ÷ hypotenuse (both in aṅgulas); × R ÷ 1397 → the Sun by quadrant. 3.41b-3.42a three tips (forenoon, noon, afternoon), two fish-figures, a thread through the three: the shadow's path (bhā-bhrama) — a circle by construction; its distance from the path is measured in the test. 2.59 the Sun's own day = 21,600 asus of the turn + its daily motion × the rising of its sign ÷ 1800: how a kapāla count of the turn becomes asus of the Sun's hour angle. Signs: arcs north of the zenith or of the equator are positive. A northern place only (3.14: the akṣa is "always south"). Longitudes are sāyana (3.10: declination, shadow and half-day come from the place corrected by the ayanāṃśa); the karaṇāgata Sun of 3.11 is sphuta.js's sidereal Sun. The text's arithmetic is not the sphere's: the test measures how far. Requires sphuta.js (the table, the Sun), ss-udaya.js (2.28, 2.60-2.63, 3.44) and kala-dvara.js (days, the yuga's counts). Browser: window.SSChaya (needs Sphuta, SSUdaya, 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

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

mod(a, m)lines 58–58
calls nothing in the registry
arcOf(x)lines 60–60
calls nothing in the registry
jyaMin(m)lines 62–62
calls nothing in the registry
called by krantiFromNoon
root2(x)lines 63–63
calls nothing in the registry
utkramajya(m)lines 68–71exported

2.23-2.27: the utkramajyā of an arc of 0…10,800′. The text's versed sines are R minus its sines read backwards (ss-numbers.test.js proves it from the words), so interpolating them is R − jyā(90° − x); past 90° it is R + jyā(x − 90°).

calls nothing in the registry
called by shadowAt
arcOfUtkramajya(v)lines 73–76exported

3.39 "utkramajyābhiḥ": the arc in minutes (0…10,800) of a versed sine 0…2R.

calls nothing in the registry
called by nataFromShadow
karna(chaya, shanku = SHANKU)lines 80–80exported

3.8: karṇa = √(śaṅku² + chāyā²).

calls nothing in the registry

3.8: chāyā = √(karṇa² − śaṅku²).

calls root2
called by samamandala
shankuOfKarna(k, chaya)lines 84–84exported

3.8 "śaṅkur viparyayāt": śaṅku = √(karṇa² − chāyā²).

calls root2
called by nothing in the registry
akshaOfPalabha(palabha)lines 89–95exported

3.12b-3.14a: from the palabhā (aṅgulas of the 12-aṅgula gnomon): the equinoctial hypotenuse (3.8), lambajyā = R × 12 ÷ it, akṣajyā = R × palabhā ÷ it, and their arcs (minutes): co-latitude and latitude.

palabhaOfLatitude(latitude)lines 98–102exported

3.16b-3.17a: from the latitude (degrees): akṣajyā by the table, lambajyā = √(R² − akṣajyā²), palabhā = 12 × akṣajyā ÷ lambajyā, and the equinoctial hypotenuse 12 × R ÷ lambajyā (3.13 read backwards).

calls nothing in the registry
dirSign(dir)lines 105–105

── 3.14b-3.19: the noon shadow read backwards ─────────────────────────────────────────────────

calls nothing in the registry
nataOfNoonShadow(chaya, dir, opts)lines 108–113exported

3.14b-3.15a: the noon nata (signed minutes, north +) from the noon shadow and where it points. The hypotenuse is the shadow's own (3.8) unless `opts.karna` gives it. North when the shadow is south, south when it is north.

3.15b-3.16a: the latitude (minutes) from a noon shadow and the Sun's declination (signed minutes). The text adds them when unlike and differences them when alike; signed, the akṣa (south, so −φ) = nata − declination.

3.17b-3.18a: the Sun's declination (signed minutes) from the noon shadow at a place of the given palabhā: latitude (south) and nata, the difference when alike, the sum when unlike; signed, declination = nata + latitude.

bhujaOfKrantijya(krantijya)lines 131–134exported

3.18b: the Sun's arc from Meṣa in the first quadrant (degrees, 0…90) from its declination's sine: arc(|krāntijyā| × R ÷ 1397). A sine past 1397 (an observation beyond the greatest declination) is held at 90° and flagged.

calls arcOf
quadrantOf(krantiSign, ayana)lines 137–141exported

3.19: the quadrant from the declination's direction and the ayana (whether the Sun is going north, "uttara", or south, "dakshina"): 0 Meṣa…Mithuna, 1 Karka…Kanyā, 2 Tulā…Dhanu, 3 Makara…Mīna.

calls nothing in the registry
inQuadrant(b, q)lines 143–143

3.19: the first-quadrant arc placed in its quadrant: as it is; from 180°; plus 180°; from 360°.

calls mod
sunFromKrantijya(krantijya, opts)lines 147–158exported

The Sun (sāyana degrees) from its declination's sine, by 3.18b-3.19. opts: quadrant (0-3), or ayana, or near (a longitude: the nearer of the two candidates with this declination). Returns both candidates: the shadow alone cannot tell λ from 180° − λ.

3.14b-3.19: the chāyārka — the true sāyana Sun at noon from the noon shadow at a place of the given palabhā.

3.20a: the mean Sun (sidereal degrees) from the true sidereal Sun: the manda equation of 2.29-2.45 (kendra = mandocca − planet, the epicycle 14° at the even ends and 13°40′ at the odd, varying by 2.38) taken in reverse and again, until it stops changing. `mandocca` in degrees (sphuta.js: mean.sunApogee).

calls mod, wrap180
called by reduce
noonShadow(lam, palabha)lines 186–193exported

3.20b-3.22a: the noon shadow of the Sun at sāyana λ: the declination by 2.28 on the table; nata = latitude (south) and declination combined; chāyā = 12 × jyā(nata) ÷ koṭijyā, karṇa = 12 × R ÷ koṭijyā; the shadow points away from the Sun.

agra(lam, palabha, karnaIshta)lines 199–207exported

3.22b-3.25a and 3.27b-3.28a: the agrā. agrājyā = krāntijyā × R ÷ lambajyā (3.27b; 3.22b with the śaṅku read as 12 gives the same as krāntijyā × the equinoctial hypotenuse ÷ 12). 3.22b-3.23a read with the noon śaṅku-sine: the noon agrā in aṅgulas = krāntijyā × the equinoctial hypotenuse ÷ the noon koṭijyā, and any shadow's own = that × its hypotenuse ÷ the noon hypotenuse; 3.28a: agrājyā × hypotenu

samamandala(lam, palabha)lines 210–217exported

3.25b-3.27a: the hypotenuse when the Sun is on the prime vertical, three ways; null unless the declination is north and less than the latitude ("saumyākṣonā krāntiḥ"), the only case in which the Sun crosses it above the horizon.

called by nothing in the registry
konaShanku(lam, palabha)lines 224–236exported

3.28b-3.34a: the Sun in an intermediate direction. karaṇī = (R²/2 − agrājyā²) × 12 × 12 ÷ (12²/2 + palabhā²); phala = 12 × palabhā × agrājyā ÷ the same; the śaṅku (a sine, R-units) = √(phala² + karaṇī) less the phala for a southern declination, plus it for a northern; dṛgjyā = √(R² − śaṅku²); shadow and hypotenuse 12 × dṛgjyā, 12 × R, ÷ śaṅku. `corners` says which pair it falls in (3.32): the Sun'

called by nothing in the registry
dina(lam, palabha)lines 240–244exported

2.60-2.61, 3.34b: the krāntijyā, dyujyā, carajyā (signed: north +) and antyā = R + carajyā of the Sun at sāyana λ.

calls nothing in the registry
shadowAt(lam, palabha, natAsus)lines 248–257exported

3.34b-3.36: the śaṅku and shadow when the Sun is `natAsus` from the meridian (east −, west +; asus of the Sun's own day, 1′ of its hour angle each). cheda = (antyā − utkramajyā(nata)) × dyujyā ÷ R; śaṅku = cheda × lambajyā ÷ R. Below the horizon the śaṅku is ≤ 0 and the shadow is Infinity.

shadowTip(lam, palabha, natAsus)lines 260–266exported

The tip of that shadow on the slab, in aṅgulas from the gnomon's foot: north = the bhuja (3.23b-3.24, with the agrā of 3.28a); east = the rest of the shadow by 3.8's rule, pointing west in the forenoon and east in the afternoon.

3.37-3.39: the nata (asus from the meridian) from a shadow measured at a place of the given palabhā on a day the Sun is at sāyana λ: dṛgjyā = R × shadow ÷ hypotenuse; śaṅku = √(R² − dṛgjyā²); cheda = śaṅku × R ÷ lambajyā; unnatajyā = cheda × R ÷ dyujyā; the arc of the versed sine antyā − unnatajyā is the nata. A shadow shorter than this arithmetic's noon shadow (an observation near noon, or a decl

The asus of the Sun's own day from its rising to a measured shadow: the half-day (2.62-2.63) less the nata in the forenoon ("purva"), plus it in the afternoon ("pashcima").

called by reduce

3.40-3.41a: the Sun from any shadow: krāntijyā = lambajyā × agrā ÷ hypotenuse (aṅgulas); × R ÷ 1397 → the arc, placed by quadrant (3.19; `opts` as for sunFromKrantijya). The agrā (north +) is the tip's distance from the east-west line through the equinoctial shadow's tip: palabhā − bhuja, with the bhuja measured north + from the gnomon's line (3.23-3.24).

bhabhrama(p1, p2, p3)lines 300–307exported

3.41b-3.42a: the circle through three marked tips {east, north} by two fish-figures: the perpendicular bisectors of the two chords meet at the centre; the thread from it through the three is the bhā-bhrama.

calls nothing in the registry
called by nothing in the registry

3.1-3.3: the east-west line from the two tips that meet a circle of radius r aṅgulas, the Sun at sāyana λ at noon and moving `motion` minutes a day. Each mark's time comes from 3.37-3.39, its tip from shadowTip; between the marks the declination moves, the two bhujas differ and the line is turned. Returns the tips and the turn in minutes (+ when the east end lies north of true east); null when the

called by nothing in the registry
svahoratraAsus(lam, gati, opts)lines 330–333exported

2.59: the Sun's own day in asus of the turn: 21,600 + its daily motion (minutes) × the Laṅkā rising of its sign ÷ 1800 (3.44's stated 1670, 1795, 1935; `{ stated: false }` for those computed from 1397). Laṅkā's, because the nata is counted from the meridian [reading].

calls mod
called by turnToSunAsus

Asus of the turn (a kapāla calibrated on a star, kala-dvara.js) → asus of the Sun's hour angle, by 2.59.

called by reduce

3.11-3.12a: the observed ayanāṃśa = chāyārka − karaṇāgata (degrees): the circle has moved east by it when the computed Sun is less than the shadow-Sun, west when more.

calls wrap180
called by reduce
only(obj, keys, where)lines 359–362
calls nothing in the registry
angulaOf(v, where)lines 364–370exported

An aṅgula reading: a number, or { angula, vyangula } with 60 vyaṅgula to the aṅgula (JM p.36, "duṣkarā").

calls only
called by validate, reduce
asusOf(c, where)lines 372–377exported

A kapāla count { ghati, vinadi, prana } → asus (1 ghaṭī = 60 vināḍī = 360 prāṇa, SS 1.11).

calls only
called by validate, reduce
kaliDayOf(d, where)lines 379–383exported

The civil day: { kali } (days since the Kali epoch) or { calendar, year, month, day } (kala-dvara.js).

calls only
called by validate, reduce
validate(file)lines 385–421exported

Checks a whole file's shape: only the fields named in corpus/vedha/README.md, in the owner's units. Throws on the first fault.

stats(xs)lines 423–423
calls nothing in the registry
called by reduce
textSun(t)lines 426–430exported

The text's Sun at Kali day t: karaṇāgata (sidereal), its mean and mandocca, the text's ayanāṃśa (3.9-3.10), and the daily motion in minutes (true place a day apart).

calls wrap180, mod
called by reduce
reduce(file, opts)lines 436–536exported

Reduces a vedha file (corpus/vedha/README.md) to what the shadows say, every derived number tagged [measured]. opts.ayanamsha: for the declination an "ishta" shadow is timed with — "text" (3.9-3.10, the default), "observed" (the mean of this file's noon ayanāṃśas) or a number of degrees. Noon is the local mean noon of the record's day, Kali day + ½ − deśāntara ÷ 360 (the equation of time, ≤ 16 min