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

प्रमाण: दृक् + स्वामी-परम्परा (Pardeep Sehrawat). Value by value:

617 lines · 28 exports

प्रमाण: दृक् + स्वामी-परम्परा (Pardeep Sehrawat). Value by value:
लेख · the header

The header, as the file states it

प्रमाण: दृक् + स्वामी-परम्परा (Pardeep Sehrawat). Value by value: स्वामी-परम्परा (Pardeep Sehrawat) — the Sun and the Moon: his Dṛk-Siddhānta series (its periodic and slow terms fitted to his EIH-1PN N-body; the series the dṛk tier of bharat-ephemeris-offline served), as this engine holds it on the lattice: the bandha tier, bandha-patra.json, read through purnanka-bandha-tantra.js — vectorB (the Earth heliocentric, the Moon geocentric, AU, in the series' sidereal ecliptic of date) and apparentB (his reduction: the Moon retarded by its own light's time, the Sun with the annual aberration); how closely the lattice holds the series is bandha-patra.json source.certification. The search is his: owner decision DK-3 (2026-10-08, "build ours now"); owner decision DK-5 gave the Moon's net +7′ horizon. भारतीय-रूप·पुनर्मापित — the frame the observer stands in, udaya-bija.js: ε (the text's 24°, SS 2.28, + measured bīja), the ayanāṃśa (the text's libration, SS 3.9–3.12, + measured bīja with the nodding), the star-rotation (SS 1.34's star-days + measured bīja), each measured against the dṛk tier's own frame 1850–2150 (the rms of each fit is in udaya-bija.json). दृक् — the clock: the civil day carried onto the series' uniform day by the kāla-bīja (bija-patra.json params.kala: the civil day's measured lag, an observation record, not a formula — bija-samskara.js step 6). And named references measured on the sky: the conventions of the shadow and the discs (each where it is written below; the citations are drik-grahana.js's, which marks them recalled, not checked against the texts): Danjon's shadow, the Moon's limb k, the Sun's semi-diameter at 1 AU, the Earth's ellipsoid, the refraction at the horizon, Bennett's refraction (display only). गणित — the geometry: the shadow cones, the discs and their overlap, exact. पाठ — the names of the phases only: sparśa (SS 4.16 "grāsa", glossed स्पर्श in the edition), madhya, mokṣa (SS 4.16, yantra/patha/editions/surya-siddhanta-full-edition.html:2837), nimīlana and unmīlana (SS 4.17, :2849 — "sakalagrahe": in a total eclipse only, so an annular site keeps its C2/C3 under contacts and null under these two names). The instants beside the names are this module's (दृक्), not the text's arithmetic: the text's own eclipse is patha/ss-grahana.js. Never दर्शन. drk-grahana.js — दृक्-ग्रहण: the lunar and solar eclipses as the sky shows them, searched on the owner's own Sun and Moon, with what one place on the Earth sees of each. The port of bharat-ephemeris-offline drik-grahana.js (2026-10-08, DK-3) onto this engine: the same search and the same shadow geometry; the Sun and the Moon from the series as this engine holds it (the bandha tier); the frame and the clock from this engine's own measured records. No outside ephemeris and no outside Earth-orientation model is here: where the old module read the dṛk tier's embedded precession–nutation, sidereal time and ΔT table, this one reads udaya-bīja (the measured ε, ayanāṃśa and star-rotation) and the kāla-bīja. eclipses(t1, t2, site, opts) every eclipse whose greatest phase falls in [t1, t2] (civil days), oldest first: lunar { type 'penumbral' | 'partial' | 'total', max, magnitude (umbral; negative for a penumbral eclipse), umbralMagnitude, penumbralMagnitude, obscuration, gamma (Earth radii, + north), contacts { P1, U1, U2, U3, U4, P4 }, phases { sparsha (U1), nimilana (U2), madhya, unmilana (U3), moksha (U4) }, semiDurationMinutes, radiiDeg, sunSiderealDeg, moonSiderealDeg, moonLatitudeDeg, kalaBijaSeconds, local { site, moonAltitudeDeg (each contact, max), visible (DK-5), visibleUpperLimb (drk-udaya's moonrise) } } solar { type 'partial' | 'annular' | 'total' | 'hybrid', typeAtGreatest, central, max, magnitude, obscuration, gamma, axisDistanceKm, greatest { latitude, longitude }, contacts { P1, P4, centralStart, centralEnd }, the places, kalaBijaSeconds, local { site, eclipsed, type, max, magnitude, obscuration, contacts { C1, C2, C3, C4 }, phases { sparsha (C1), nimilana (C2, total only), madhya, unmilana (C3, total only), moksha (C4) }, sunAltitudeDeg, visible } } site: { latitude, longitude (east +) or deshantara (east of the served meridian), height (m) }; omitted, or without a latitude → the default site, the Mahākāleśvara jyotirliṅga as meridian.js writes it (D13); null → the global rows only. opts: { kinds: ['lunar', 'solar'] (default both); conventions: any of OWN_CONVENTIONS replaced (a labelled comparison); vectorSource(t) → { sun, sunDistAU, moon, moonDistAU } (apparent unit vectors on the true equator of date: another sky for a labelled comparison; rows made so carry source 'referee') }. null when the search window (t1 − 0.6 d … t2 + 0.6 d), or an eclipse's ±0.35-d window, leaves the span. geometryAt(t, site, opts) the geometry at one instant straight from the series (no interpolant): lunar { gammaDeg, umbraDeg, penumbraDeg, moonDeg, axisDistanceKm, umbralMagnitude, penumbralMagnitude }, solar { axisDistanceKm, l1Km, l2Km, outlineKm }, local { separationDeg, sunDeg, moonDeg, moonUmbraDeg, magnitude, obscuration, axisDistanceKm, sunAltitudeDeg, moonGeocentricAltitudeDeg }; null outside the span. withJd(rows, jdOfDays) the rows with a `jd` mirror of every instant, made by the door's own day-number function (web.js passes meridian.js jdOfDays): the Julian day stays at the door; this module counts civil days only. span() [first, last] civil day served. TIME: civil days t since midnight at Laṅkā at the Kali start (SS 1.45–47), counted on the served meridian (meridian.js, D13). The series runs on its uniform day τ = the record's own day + the kāla-bīja (purnanka-bandha-tantra.js tauOf). Every instant out is a civil day; kalaBijaSeconds says how far the civil day lags the uniform day at that instant. SPAN: the window on which the engine measured the owner's sky (bija-patra.json `window`, 1850–2150: the udaya-bīja and the bīja were measured on it, the kāla-bīja's knots cover it, and the series is certified on the same years). Outside it every entry returns null (EDGE RULE, as DK-1: never filled from elsewhere). GEOMETRY (as drik-grahana.js): Positions: the apparent geocentric Sun and Moon of the series, turned onto the true equator and equinox of date by the udaya-bīja frame: θ about the ecliptic's pole (θ = the measured ayanāṃśa of the IAE zero less the record's frame constant, bandha-patra.json frame.offsetDeg, so that series λ + θ = the true sāyana λ), then ε about the equinox line. The shadow axis is the ray from the Sun through the Earth (lunar) or the Moon (solar), through the apparent places (the Besselian convention). Lunar: Danjon's shadow ρ_u = DANJON·π☾ + π☉ − s☉, ρ_p = DANJON·π☾ + π☉ + s☉; magnitudes (ρ + s☾ − γ)/(2 s☾), γ the Moon's angular distance from the axis; contacts P1/P4 at γ = ρ_p + s☾, U1/U4 at γ = ρ_u + s☾, U2/U3 at γ = ρ_u − s☾; the greatest eclipse at the least linear distance of the Moon's centre from the axis. Solar, global: the cones tangent to the Sun and the Moon (sin f1 = (R☉ + R☾)/|S − M|, sin f2 = (R☉ − R☾′)/|S − M|; l1, l2 on the plane through the Earth's centre normal to the axis); the greatest eclipse when the axis passes nearest the Earth's centre; the flattening by scaling the polar coordinate by 1/(1 − f) (exact for the axis, close for the cones); the type (central, total, annular, hybrid, partial) decided as drik-grahana.js decides it. Solar, local: topocentric discs (the observer on the ellipsoid under the measured star-rotation): C1/C4 at σ = s☉ + s☾, C2/C3 at σ = |s☉ − s☾′|, the maximum at the observer's least distance from the axis; magnitude (s☉ + s☾ − σ)/(2 s☉), or s☾/s☉ in the central phase; obscuration the covered part of the Sun's disc. Between seven series evaluations per eclipse the apparent Sun and Moon and the two frame angles are carried by a Chebyshev interpolant (±0.35 d); every contact and maximum is fixed to 1e-9 day. Trigonometry: Mādhava's series only (the bandha tier's jyā/koṭijyā, madhava-ganita's arc); no library trigonometry on this path. HONESTY (carried from the dṛk tier): the N-body behind the series is restarted from the JPL states every 720 days, so its agreement with JPL is not independence from it; the kāla-bīja's knots were read from the dṛk tier's own clock record (tantra/bija-mapana/seal-patra.js), which after 2027 is a prediction, so a civil instant after 2027 carries that uncertainty.
आवश्यक · requires

What it loads

required by
निर्यात · exports

What it exports

eclipsesgeometryAtwithJdspanoverlapFractionrefractionDegOWN_CONVENTIONSCONSTANTSAU_KMEARTH_A_KMEARTH_INV_FK_MEANK_UMBRASUN_SD_1AU_ARCSECSUN_R_KMDANJONMOON_HORIZON_DEGSUN_HORIZON_DEGREFRACTION_ARCMINNODESHALF_WINDOWSEARCH_HALFEDGE_MARGINPRUNE_LAT_DEGPRAMANAlabelLABELsource
पाठ · the verses it cites

SS verses named in the header

  • SS 2.28verse
    paramāpakramajyā tu saptarandhraguṇendavaḥ । tadguṇā jyā trijīvāptā taccāpaṃ krāntirucyate ।।
  • SS 3.9verse
    triṃśatkṛtyo yuge bhānāṃ cakraṃ prākparilambate । tadguṇādbhūdinairbhaktāddyugaṇādyadavāpyate ।।
  • SS 1.34verse
    bhānāṃ aṣṭākṣivasvadritridvidvyaṣṭaśarendavaḥ । bhodayā bhagaṇaiḥ svaiḥ svairūnāḥ svasvodayā yuge ।।
  • SS 4.16verse
    sphuṭatithyavasāne tu madhyagrahaṇaṃ ādiśet । sthityardhanāḍikāhīne grāso mokṣastu saṃyute ।।
  • SS 4.17verse
    tadvadeva vimardārdhanāḍikāhīnasaṃyute । nimīlanonmīlanākhye bhavetāṃ sakalagrahe ।।
  • SS 1.45verse
    ṣaṇmanūnāṃ tu sampīḍya kālaṃ tatsandhibhiḥ saha । kalpādisandhinā sārdhaṃ vaivasvatamanostathā ।।
  • SS 1.46verse
    yugānāṃ trighanaṃ yātaṃ tathā kṛtayugaṃ tvidam । projjhya sṛṣṭestataḥ kālaṃ pūrvoktaṃ divyasaṃkhyayā ।।
  • SS 1.47verse
    sūryābdasaṃkhyayā jñeyāḥ kṛtasyānte gatā amī । khacatuṣkayamādryagniśararandhraniśākarāḥ ।।
नलिका · channels

The channels it runs in

कार्य · the functions

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.

sc(rad)lines 97–97

[jyā, koṭijyā] of an angle in radians: Mādhava's series, the quadrant taken on the lattice (purnanka-bandha-tantra.js jyaK).

sin(rad)lines 98–98
calls sc
called by lunarGeometry
atan2(y, x)lines 100–100

the arc of (y, x), radians in (−π, π]: Mādhava's arc series with the tri-karaṇī step (madhava-ganita.js capa).

clamp1(x)lines 101–101
calls nothing in the registry
acos(x)lines 103–103
calls clamp1, atan2
called by overlapFraction
conventionsOf(o)lines 142–142
calls nothing in the registry
called by eclipses, geometryAt
n360(x)lines 151–151

── small vector helpers ────────────────────────────────────────────────────────────────────────────────────────────────

calls nothing in the registry
wrap180(x)lines 152–152
sub(a, b)lines 153–153
calls nothing in the registry
scl(a, s)lines 154–154
cross(a, b)lines 155–155
calls nothing in the registry
called by angle
nrm(a)lines 156–156
angle(a, b)lines 157–157
calls atan2, nrm, cross
called by lunarGeometry, topo
dilate(v)lines 158–158
calls nothing in the registry
called by solarGeometry
overlapFraction(r1, r2, d)lines 161–168exported

Fraction of disc 1 (radius r1) covered by disc 2 (radius r2) at centre distance d (planar; small angles). गणित

calls clamp1, acos
refractionDeg(altDeg)lines 171–176exported

दृक्: Bennett's (1982) refraction in degrees from the true geometric altitude altDeg — display only (the contacts are geometric).

calls sc
span()lines 182–185exported

[first, last] civil day served: bija-patra.json `window` (the owner's sky as the engine measured it) on the served day count.

tQ(t)lines 188–188

a civil instant on the 1e-9-day grid (86 µs), as the exact rational the bandha tier takes

called by tauAt
tauAt(t)lines 190–190

civil t → the series' uniform day τ: the record's own day + the kāla-bīja (purnanka-bandha-tantra.js tauOf)

kalaBijaSeconds(t)lines 192–192

the kāla-bīja at civil t: seconds by which the civil day lags the series' uniform day (bija-patra.json params.kala)

frameAt(t)lines 195–195

the frame at civil t, degrees: θ turns the series' frame onto the true equinox of date (series λ + θ = the true sāyana λ), ε the measured obliquity of date (udaya-bija.js ayanamshaIAE and epsilon; bandha-patra.json frame.offsetDeg)

gastAt(t)lines 197–197

the Greenwich meridian's sāyana place (its right ascension), degrees, at civil t: udaya-bija.js rotation (the measured star-rotation)

the series' frame → the true equator and equinox of date: θ about the ecliptic's pole, then ε about the equinox line

calls sc
apparentSeries(t)lines 205–209

the apparent geocentric Sun and Moon at civil t in the series' frame: position vectors (AU) and unit vectors (apparentB)

stateOf(t, S, M)lines 211–216

a state from the two apparent position vectors (AU) on the true equator of date

calls nrm, scl
stateAt(t, src)lines 218–223

the state straight from the series (or the comparison source) at civil t; null outside the span

buildWindow(cT, src)lines 226–258

── the Chebyshev interpolant of the apparent Sun and Moon (series frame, AU) and the frame angles over [cT − 0.35, cT + 0.35] ──

at(t)lines 241–246
calls nothing in the registry
called by buildWindow, state
state(t)lines 249–256

the geocentric apparent Sun and Moon on the true equator of date, km, at civil t

called by nothing in the registry
minimise(f, a, b)lines 262–274

Global minimum of f on [a, b]: a 48-point scan, then golden section on the best bracket, to 1e-9 d.

calls nothing in the registry
findRoot(f, x0, x1)lines 276–286

The root of f between x0 (f < 0) and x1 (f > 0) by bisection with a secant step, to 1e-9 d; null if f does not change sign.

calls nothing in the registry
lunarGeometry(s, C)lines 289–294

── lunar eclipses ──────────────────────────────────────────────────────────────────────────────────────────────────────

calls scl, angle, asin, sin
called by lunarAt, g, geometryAt
g(t)lines 297–297
called by nothing in the registry
pair(fR)lines 304–308

f = R − γ is > 0 inside a phase and < 0 outside it; findRoot() wants f(x0) < 0 < f(x1)

calls g, findRoot
called by lunarAt
solarGeometry(s, C)lines 323–337

── solar eclipses ──────────────────────────────────────────────────────────────────────────────────────────────────────

calls sub, nrm, scl, dilate
called by solarAt, g, geometryAt
supportPoint(n, h)lines 339–339

The ellipsoid's support point in direction n (the limb point nearest the axis when the axis misses the Earth).

calls nothing in the registry
called by solarAt
axisSurfacePoint(G)lines 341–346

The near-side meeting of the axis with the ellipsoid (geocentric km), or null.

calls sub, scl
called by solarAt
geodeticOf(P, gastDeg)lines 348–351

geodetic latitude and east longitude (degrees) of a geocentric point P (km) under the star-rotation gastDeg

calls atan2, wrap180
called by solarAt

the observer on the ellipsoid (km, the true equator of date) and the local vertical, under the star-rotation gastDeg

calls sc
topo(s, O, C)lines 360–364

Topocentric disc geometry at an observer position O (km); mKm = the observer's distance from the shadow axis.

magnitudeOf(q)lines 365–365
calls nothing in the registry
g(t)lines 370–370
q(t)lines 411–411
outer(t)lines 412–412
calls q
called by localSolar
altAt(t)lines 426–427
apparentAltAt(t)lines 428–428
called by nothing in the registry
syzygies(t0, t1, endT)lines 436–471

Geometric syzygies (elongation 0 or 180 on the series' raw vectors; light's time and aberration left out: a search aid only) in [t0, t1] (civil days inside the span, whose last day is endT). The rate is the series' own mean synodic motion: the Moon's mean longitude rate less the Earth's (bandha-patra.json angles L_M, L_E).

insideOrDone()lines 449–454

an estimate or iterate past the span's end is decided at the end itself: the elongation has not reached the target there → this syzygy falls after the span, so after t1, and is not needed (the search ends; nothing outside is asked for); reached → the syzygy lies inside and the secant resumes from the end

calls wrap180, probe
called by syzygies

A finite number, or TypeError (null is kept for "outside the span").

calls nothing in the registry
called by eclipses, geometryAt
checkSite(site)lines 478–489

the site: null → none (the global rows only); omitted or without a latitude → the default site read from meridian.js (D13)

calls nothing in the registry
called by eclipses, geometryAt
siteOut(S)lines 490–490
calls nothing in the registry
placesAt(t)lines 494–498

The Sun's and the Moon's places at civil t from the series (the bandha tier's apparent places), in the served nirayaṇa frame: series λ − the record's frame constant (the IAE zero) + dhruva (D21: Citrā at 180°); the Moon's latitude on the ecliptic of date.

lon(u)lines 496–496
calls n360, atan2
called by placesAt
eclipses(t1, t2, site, opts)lines 503–519exported

Eclipses whose greatest phase falls in [t1, t2] (civil days since Laṅkā midnight at the Kali start, the served meridian), oldest first; with the local rows at the site (see the header). null when the search window (t1 − 0.6 d … t2 + 0.6 d), or an eclipse's ±0.35-d window, leaves the span. A day that is not a finite number throws TypeError; t2 before t1, RangeError.

called by nothing in the registry
geometryAt(t, site, opts)lines 521–541exported

The eclipse geometry at one instant (civil t), straight from the series (no interpolant); see the header. null outside the span.

withJd(rows, jdOf)lines 600–611exported

The rows with a `jd` mirror of every instant (max, contacts, phases; the local ones too), made by the door's own day-number function — web.js passes meridian.js jdOfDays, so the Julian day is read at the door and this module counts civil days only.

calls m, each, tree
called by nothing in the registry
m(v)lines 603–603
calls nothing in the registry
called by withJd, each, tree
each(o)lines 604–604
calls m
called by withJd, tree
tree(r)lines 605–609
calls m, each
called by withJd