yantra/patha/yantra.js
यन्त्र: the instruments, on the owner's latitude and the text's own Sun.
971 lines · 0 exports
The header, as the file states it
What it loads
- yantra/patha/sphuta.jsmodule
- yantra/patha/kala-dvara.jsmodule
- yantra/patha/ss-udaya.jsmodule
- yantra/patha/ss-chaya.jsmodule
- yantra/patha/ss-grahana.jsmodule
What it exports
SS verses named in the header
none in the registry
The channels it runs in
Every function, what it calls, who calls it
68 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.
Signed R-sine of an arc in degrees (sphuta.js: Mādhava's, or the table with withSine("table")).
The koṭijyā: the R-sine of the complement (the R-cosine).
The arc (degrees, 0…90) whose sine is to its cosine as the leg y to the leg x (both ≥ 0): bhuja, koṭi, karṇa = √(y² + x²); the smaller leg × R ÷ karṇa is taken to its arc (2.33), and the other arc is 90° less it.
The angle (degrees, 0 ≤ … < 360) of a direction from its component along the zero direction (x) and along the 90° direction (y), placed by quadrant as 2.29-2.30 place a bhuja.
A signed arc in (−90°, 90°): the sign of y, the arc of the legs.
Length along a circle of radius r of an arc of `arcmin` minutes: r × arcmin ÷ ρ.
The minutes of arc that a length along a circle of radius r spans.
The chord of an arc of `deg` degrees on radius r: 2r × jyā(deg ÷ 2) ÷ R (signed with the arc).
r × tan(deg) by the sine and its koṭi.
Asus → { ghati, vinadi, prana } (prana fractional unless `round`).
Degrees → { amsha, kala, vikala } of its magnitude (vikala fractional unless `round`).
{ amsha, kala, vikala } → degrees, refused outside 0 ≤ … ≤ max (or < max when `open`).
A nata { ghati, vinadi, prana } → asus (at most half a turn).
The owner's place: { latitude (degrees, northern) | palabha (aṅgula), deshantara (degrees east of Ujjayinī's meridian) }. The palabhā by 3.16b-3.17a from a latitude; akṣajyā and lambajyā from the palabhā over the equinoctial hypotenuse (3.13).
── the sky: the text's Sun and stars, and the frame ───────────────────────────────────────────────
The text's Sun at t: its sāyana place (sphuta.js, 3.9-3.10), the sine of its declination (2.28) and its day-radius (2.60), its right ascension (3.42 at its point), the meridian's asus (the turn, ss-grahana.js) and its hour angle, nata = meridian − ascension (asus, west +). opts.ayanamsha: degrees in place of the text's.
A junction star at t: its polar longitude (dhruvaka + ayanāṃśa), its declination = the polar longitude's with the vikṣepa (2.58, 2.63), its right ascension (3.42 at its dhruvaka) and its hour angle — as vedha-lekha.js predicts a transit.
A body's direction in the horizon frame, in R-units, from the sine of its declination kj, its day-radius dj and its nata (asus, west +). up = the śaṅku of 3.34b-3.36 = (kṣitijyā + dyujyā × koṭijyā(nata) ÷ R) × lambajyā ÷ R (the cheda written out; kṣitijyā 2.61); north = agrājyā − śaṅkutala = kj × R ÷ lambajyā − śaṅku × palabhā ÷ 12 (3.27b, 3.23b-3.24 in R-units); east = −dyujyā × jyā(nata) ÷ R, th
The horizon direction (R-units) of an altitude and an azimuth (degrees from the north point through the east).
Altitude (−90…90) and azimuth (0…360 from north through east) of a horizon direction.
The rotation back by the latitude: R sin δ = (north × lambajyā + up × akṣajyā) ÷ R; R cos δ cos H = (up × lambajyā − north × akṣajyā) ÷ R; R cos δ sin H = −east. Returns the declination (degrees) and the nata (asus, west +).
Everything an instrument can read of a body in state `st`: the nata, the declination and its gola, the altitude, the azimuth, the zenith distance and the side of the zenith (disha: the horizon the altitude is read from).
The instant on civil day N at which the body's nata is `natAsus`: for the Sun, near the text's local noon of day N (N + ½ − deśāntara ÷ 360); for a star, in the turn that begins six hours after local midnight.
The instant, in the turn that begins six hours after local midnight of day N, at which the meridian's asus are `asus`.
3.37-3.39 for any body: the nata (asus, 0…10,800) at which a body of declination-sine kj and day-radius dj stands at the śaṅku `up` (the R-sine of its altitude): cheda = śaṅku × R ÷ lambajyā; unnatajyā = cheda × R ÷ dyujyā; less the carajyā = kṣitijyā × R ÷ dyujyā (2.61) it is the koṭijyā of the nata (R − (antyā − unnatajyā)). null when never reached.
The instant on day N at which the body stands at altitude `unnataDeg` on the given side of the meridian ("purva", east, before its transit; "pashcima", west). null when it does not reach that altitude.
The instant on day N at which the body stands at azimuth `digamshaDeg`: east of the meridian (0° < A < 180°) before its transit, west after; the nata found by halving on that side, the body's place renewed at each instant found.
── what every instrument shares ───────────────────────────────────────────────────────────────────
An instrument: its static parts, and predict(t, opts) → { quantities, position, reading } at t (opts.star for a star).
The declinations of the sign ends (13.6-13.7): Meṣa…Mithuna's, the same reversed for Karka…Kanyā, southern for Tulā on.
शङ्कु — the gnomon of chapter 3 (13.20 names it), of height `height` (aṅgula; 12 by 3.2), wrapped from ss-chaya.js.
The bowl's sinking, exactly (owner, 2026-10-27: "whatever is perfect for the model"). A thin bowl floats while the water it puts aside equals its own load and the water inside; the water comes in by the hole at the speed of a fall through the head h — the outer depth less the inner — √(2gh). shape "hemisphere" (depths in its radius; filled part (3z² − z³)/2 of the whole) or "cylinder" (depths in i
गोलयन्त्र — the sphere of 13.3-13.17, set to the latitude. Rings of `circumference` aṅgulas (180 by 13.5: the degrees of a revolution as aṅgulas, halved), so half an aṅgula to a degree along every great ring; the diurnal circles at their declinations, halved, north and south (13.6-13.7), each of its own radius (svāhorātrārdhakarṇa, 13.5); the ecliptic (krānti, 13.12) at the greatest declination; t
Points of the instrument relative to a centre, as { east, north, up } in the owner's unit.
सम्राट् — the gnomon along the axis. Sizes: one of hypotenuse | height | base; radius of the quadrants; centre = the quadrants' centre's distance along the hypotenuse from its lower (south) end (default: the middle). [theorem] The hypotenuse is parallel to the axis, so it rises northward at the latitude; tan φ = palabhā ÷ 12, so the gnomon is the equinoctial shadow triangle — base : height : hypot
नाडीवलय — a dial of radius r in the equator's plane, a pin of length `pin` on each face at the centre, along the axis. [theorem] The north face (uttara) looks at the north pole and is lit while the declination is north, the south face (dakṣiṇa) while it is south. The pin's shadow on the lit face lies at the nata from the dial's lowest radius, toward the east edge after noon; its length is pin × ko
The hemispherical bowl (Jaya Prakāśa; Kapāla): radius r, rim level, cross-wires meeting over its centre. [theorem] The wires' crossing throws its shadow at the point of the bowl opposite the body: depth r × jyā(altitude) ÷ R below the rim, r × koṭijyā(altitude) ÷ R from the axis, bearing azimuth + 180°; the bowl is the sky inverted, its lowest point the zenith's image, the pole's image south of th
जयप्रकाश — the hemispherical bowl under cross-wires.
कपाल यन्त्र — the same hemisphere [reading].
राम यन्त्र — a pillar of height `pillar` at the centre of an open cylinder of radius `radius`, its wall of height `wall` (default: the pillar's). [theorem] The pillar-top's shadow lies at bearing azimuth + 180°, on the floor at pillar × koṭijyā(a) ÷ jyā(a) from the foot while that is within the radius, else on the wall at height pillar − radius × jyā(a) ÷ koṭijyā(a); the change is at the altitude
दिगंश यन्त्र — a pillar at the centre of a circular wall of radius `radius`, its top graduated in azimuth from the north point through the east. [theorem] A body is sighted at its azimuth's mark; the pillar's shadow falls at azimuth + 180°.
षष्ठांश यन्त्र — a sixty-degree arc of radius `radius` in the meridian under a pinhole at its centre. [theorem] At noon the Sun's image falls on the arc at its zenith distance from the point under the pinhole, on the side away from the Sun; at noon the zenith distance is φ − δ, so the arc can be labelled in declination as well. The arc is centred on the equinox's noon (zenith distance φ) unless `c
दक्षिणोत्तर भित्ति — a wall in the meridian; a pin perpendicular to it at the centre of two quadrants of radius `radius` below it, one each side. [theorem] At transit the Sun's shadow of the pin falls on the quadrant on the side away from it, the altitude below the pin's horizontal; a star is sighted from the same mark through the pin.
राशिवलय — twelve gnomons with quadrants of radius `radius`. [theorem] The k-th is set along the ecliptic's pole at the moment sign k's first point (sāyana 30k°) is on the meridian — when the meridian's asus equal that point's right ascension (3.42 at the point); then its quadrants lie in the ecliptic's plane and the shadow of its edge falls at the Sun's distance in longitude from the ecliptic's hi
उन्नतांश यन्त्र — a ring of radius `radius` in a vertical plane that turns on a vertical axis, a sight pivoted at its centre. [theorem] The altitude is read from the ring's level diameter: arc r × a, chord 2r jyā(a ÷ 2) ÷ R.
An instrument by its catalogue key, with the owner's site and sizes.
Checks a "yantra" record's instrument, body and reading (its own graduation's fields only). Throws on the first fault.
A reading → the quantities it states (nata asus west +, declination, altitude, azimuth, signed zenith distance, longitude).
The reading of a set of predicted quantities as instrument `key` shows it (the labels a "yantra" record carries).
A ledger record of kind "yantra" (vedha-lekha.js): { id, day, body ("surya" or a star's name), reading, kapala?, calibration?, observer?, note?, synthetic?, generator?, ganita? }. The reading is checked first.
Reduces one "yantra" record: what it measured [measured], the instant it is compared at, the text's quantities there, and the antara (observed − the text). ctx: { N (its civil day), t (the instant by the bowl, when it carries a kapala), star (the catalogue entry, when the body is a star) }. The instant, in order: the bowl's count; the meridian for the wall and the arc (and a ring read with a disha