Panchang

How Panchang Calculations Work

A deep dive into tithi, nakshatra, yoga, and karana computation using Swiss Ephemeris.

TathaAstu Team10 min read

Panchang means "five limbs". Every one of them is a function of the sidereal positions of the Sun and Moon, which means all five reduce to a single astronomical question asked in five different ways.

The sidereal frame

Western astronomy generally uses the tropical zodiac, anchored to the equinox. Hindu calendar calculation uses the sidereal zodiac, anchored to the fixed stars. The offset between them is the ayanamsa, currently around 24 degrees and increasing by roughly 50 arcseconds a year.

We use the Lahiri ayanamsa, the Indian standard. This choice is not cosmetic: get the ayanamsa wrong and every nakshatra boundary shifts.

The five limbs

  • Tithi — the Moon's longitude minus the Sun's, divided into 30 segments of 12 degrees each.
  • Nakshatra — the Moon's sidereal longitude divided into 27 segments of 13 degrees 20 minutes each.
  • Yoga — the sum of Sun and Moon longitudes, divided into 27 segments.
  • Karana — half a tithi; 6 degrees of elongation. There are 11 karanas cycling through 60 half-tithis in a lunar month.
  • Vara — the weekday, which unlike the other four is a simple count from sunrise.

Four of the five are angular thresholds. That is why they are intervals rather than labels: the tithi does not change at midnight, it changes at the instant the elongation crosses a multiple of twelve degrees.

Why boundaries matter more than labels

Most calendar APIs return the tithi that was running at sunrise and call it "the tithi for that day". That is a useful summary and a poor primitive. If Chaturdashi ends at 11:28, then for most of that working day it is Amavasya, and any scheduling logic keyed to the sunrise label will be wrong for the majority of the day.

Boundaries, not just a label
{
  "tithi": {
    "number": 14,
    "name": "Chaturdashi",
    "paksha": "KRISHNA",
    "period": {
      "start": "2026-11-07 10:48:00",
      "end":   "2026-11-08 11:28:00"
    }
  }
}

Kshaya and vriddhi

Because tithi length varies, a tithi can occasionally be short enough that it never contains a sunrise — that is kshaya, a "lost" tithi. Or long enough to contain two — vriddhi, a repeated tithi. Neither is an error; both are ordinary consequences of the Moon's variable speed.

An engine that models tithis as intervals gets both for free. An engine that models them as per-day labels has to special-case each one, which is where most calendar bugs live.

PanchangAstronomyEducation