Skip to main content
A · Canonical textChapter 2

Panchanga Formulations & Root-Finding Mathematics

The mathematical formulations behind the Five Limbs (Pañca Aṅga) of Vedic calendrics, continuous boundary root-finding algorithms (Brent’s Method), and dynamic multi-Karana evaluation.

Sūrya Siddhānta

Cited for: The reckoning of a tithi as each 12° of the Moon's longitude gained on the Sun's, a weekday as one sunrise to the next, and a nakṣatra from the Moon's place among the twenty-seven divisions of the ecliptic.

The wording is not quoted here: the locus has not been checked against an edition.

1. Limb 1: Tithi (Lunar Phase Elongation)

A Tithi is the temporal interval required for the Moon’s celestial longitude to advance by exactly 12 degrees (12°) relative to the Sun. The synodic lunar month comprises 360° / 12° = 30 Tithis, divided into two lunar fortnights:Śukla Pakṣa (Tithis 1–15, culminating in Pūrṇimā) andKṛṣṇa Pakṣa (Tithis 16–30, culminating in Amāvāsyā).

Tithi Number & Phase Fraction

Δλ = (λ_Moon - λ_Sun) mod 360°
Tithi_Number = ⌊ Δλ / 12° ⌋ + 1
Fraction_Elapsed = (Δλ mod 12°) / 12°
Because the Moon moves in an eccentric orbit (varying between 11.8°/day at apogee and 15.3°/day at perigee), a Tithi's actual duration varies from approximately 19 to 26 hours. A Tithi active at local sunrise is the civil Tithi of that Vedic day.
Parameters & variables
Δλ
Solilunar Elongation: Angular separation between Moon and Sun along the ecliptic(0° to 359.999°)
Tithi_Number
Integer Index: 1 to 15 (Shukla Paksha), 16 to 30 (Krishna Paksha)(integer)

2. Limb 2: Nakṣatra & Pāda

The sidereal zodiac of 360° is divided into 27 equal lunar mansions (Nakṣatras), each spanning an arc of 360° / 27 = 13° 20' = 13.3333°. Each Nakshatra is further subdivided into 4 quarters (Pādas) of 13° 20' / 4 = 3° 20' = 3.3333°, creating 108 padas matching the Navāṁśa D9 harmonic division.

Nakṣatra & Pāda Index

Nakṣatra_Index = ⌊ λ_Moon / 13.3333° ⌋ + 1
Pāda_Number = ⌊ (λ_Moon mod 13.3333°) / 3.3333° ⌋ + 1
Determined strictly from the Moon's apparent sidereal longitude (Nirayana) using Lahiri Ayanamsha.
Parameters & variables
λ_Moon
Sidereal Moon Longitude: Apparent sidereal longitude measured from 0° Mesha(degrees)
Nakṣatra_Index
Asterism ID: 1 (Aśvinī) through 27 (Revatī)(1 to 27)
Pāda_Number
Quarter ID: 1, 2, 3, or 4 within the current Nakshatra(1 to 4)

3. Limb 3: Solilunar Yoga

Unlike Tithi (which measures the difference between lunar and solar longitudes),Yoga measures the sum of the Sun and Moon’s sidereal longitudes, divided into 27 equal segments of 13° 20'.

Solilunar Yoga Index

Σλ = (λ_Sun + λ_Moon) mod 360°
Yoga_Index = ⌊ Σλ / 13.3333° ⌋ + 1
There are 27 Yogas starting from Viṣkambha (1) through Vaidhṛti (27). Specific Yogas (Vyatīpāta #17 and Vaidhṛti #27) represent inauspicious astrological conjunctions that require specialized Muhurta exclusions.
Parameters & variables
Σλ
Combined Longitude: Sum of sidereal Sun and Moon longitudes(degrees)
Yoga_Index
Yoga Number: 1 (Viṣkambha) to 27 (Vaidhṛti)(1 to 27)

4. Limb 4: Karaṇa (Half-Tithi Intervals)

A Karaṇa is equal to half a Tithi, spanning 6 degrees (6°) of lunar elongation. In a 30-Tithi lunar month, there are exactly 60 Karaṇas composed of:

  • 4 Fixed (Sthira) Karaṇas: Occur only once per month: Śakuni (Kṛṣṇa 14-2), Catuṣpada (Amāvāsyā-1), Nāga (Amāvāsyā-2), and Kiṃstughna (Śukla 1-1).
  • 7 Movable (Cara) Karaṇas: Repeat cyclically 8 times across the remaining 56 half-tithis: Bava, Bālava, Kaulava, Taitila, Gara, Vaṇija, and Viṣṭi (Bhadrā).
Viṣṭi (Bhadrā) Classical Inauspiciousness:

Viṣṭi Karaṇa corresponds to the inauspicious mythological entity Bhadrā. The muhūrta literature (Muhūrta Cintāmaṇi among it) advises against auspicious beginnings (marriage, travel, foundation laying, commercial agreements) during Bhadrā.

5. Continuous Boundary Root-Finding via Brent’s Algorithm

Finding the exact second a Tithi, Nakshatra, or Yoga concludes requires locating the root t^* of the continuous nonlinear angular function:

Root-Finding Objective Function

Continuous boundary crossing equation, solved to about a second

Complexity: O(log((b-a)/ε)) superlinear convergence
f(t) = (λ(t) mod θ_step) - target_boundary = 0
The engine solves this with Brent's method, which combines bisection with the secant method and inverse quadratic interpolation, to a tolerance of 1.15 × 10⁻⁵ days (about one second) and at most 60 iterations.
Parameters & variables
t
Julian Day Time (UT): Continuous time variable in Ephemeris Julian Date(Julian Days)
θ_step
Arc Step: 12° for Tithi, 6° for Karana, 13°20′ for Nakshatra/Yoga(degrees)
ε
Convergence Tolerance: 1.15 × 10⁻⁵ Julian Days(about 1 second)

Implementation reference

def find_boundary_transition(t_start, t_end, target_boundary, arc_func):
    """Brent's method root-finder with continuous circular phase unwrap."""
    def objective(t):
        val = arc_func(t) % 360.0
        diff = (val - target_boundary) % 360.0
        if diff > 180.0:
            diff -= 360.0
        return diff
    
    return scipy.optimize.brentq(objective, t_start, t_end, xtol=1e-5)

Panchanga limb sandbox

Illustration, not the engine

Move either longitude and watch the three limbs that follow from them. This classifies a single instant; the engine additionally solves for the moment each limb ends, which is the figure an almanac actually publishes.

Tithi — (Moon − Sun) mod 360, ÷ 12°
Saptamī#7
Śukla pakṣa (waxing) · elongation 82.70° · 89% elapsed
Nakṣatra — Moon ÷ 13°20′
Maghā
#10 · pāda 3
Yoga — (Sun + Moon) mod 360, ÷ 13°20′
Harṣaṇa
#14