India
Astronomy & Tools

Astronomical Ephemeris in the Browser: Computing Surya Siddhanta & Lahiri Panchang Elements

How this site's panchang engine computes tithi, nakshatra, yoga and karana from the positions of the Sun and Moon — Surya Siddhanta roots, Lahiri ayanamsha, sunrise rules, and why festival dates shift from Delhi to Berlin.

By Dr. Aarav Sharma • • 871 views
Astronomical Ephemeris in the Browser: Computing Surya Siddhanta & Lahiri Panchang Elements

Every date on this website — every tithi, every muhurat, every "Berlin does it on Monday afternoon but Delhi on Tuesday morning" — comes out of one small engine and two numbers. The two numbers are the positions of the Sun and the Moon. Everything else in a panchang is arithmetic done on those two positions, plus one local fact: when the sun rises where you live.

That is not a simplification for beginners. That is genuinely the whole machine. This page explains the machine, because a calendar you cannot inspect is just another WhatsApp forward with better design.

The five limbs are five calculations

Panchang means "five limbs": tithi, nakshatra, yoga, karana and vara. Here is what each one actually is, stripped of poetry:

ElementWhat it tracksThe arithmetic
TithiThe Moon pulling away from the SunElongation (Moon − Sun) ÷ 12° — 30 tithis per lunar month
NakshatraWhere the Moon is against the starsMoon's longitude ÷ 13°20′ — 27 nakshatras
YogaSun and Moon combined(Sun + Moon) ÷ 13°20′ — 27 yogas
KaranaHalf a tithiElongation ÷ 6° — 60 karanas per month
VaraThe weekdayCounted from local sunrise, not midnight

How a panchang is calculated infographic — six steps from the Sun and Moon's longitudes to a festival date

So a panchang needs exactly three inputs: the Sun's longitude, the Moon's longitude, and your sunrise. Get those right and the five limbs fall out. Get the sunrise wrong — use Delhi's for a reader in London — and every festival day you publish is a small lie told with great confidence.

Sidereal, tropical, and the 24 degrees that start arguments

Longitudes can be measured two ways. The tropical zodiac starts at the March equinox and moves with the seasons. The sidereal zodiac is fixed to the stars. The gap between them is the ayanamsha, and it grows by roughly 50 arc-seconds a year as the equinox precesses — about a degree every 72 years.

Indian astronomy has watched that gap for a long time. The Surya Siddhanta, the foundational text this site's method descends from, already tracks the slow swing of the solstices against the stars and builds corrections for it. Modern panchangs mostly use the Lahiri ayanamsha — just over 24 degrees at the time of writing — named for N. C. Lahiri and standardised by India's Calendar Reform Committee in the 1950s. It is the ayanamsha behind the government's Rashtriya Panchang, and the one this site uses.

Other ayanamshas exist — Raman's, Krishnamurti's, a handful more — and they differ by a degree or so. That is sometimes enough to push a tithi ending across a sunrise, which is why two honest panchangs can give you two different festival days and both show their working. When this site and your family panchang disagree, the ayanamsha is the first place to look.

From the Surya Siddhanta to an ephemeris

The Surya Siddhanta's method, in outline: start from mean motions — the Sun and Moon's average speeds, counted in revolutions over a yuga of 4,320,000 years — then apply corrections (the manda and shighra adjustments, epicyclic in spirit) to get true positions for the day you want. It is a remarkable piece of work, and for naked-eye astronomy it is startlingly good.

What a modern engine does differently is not the logic but the precision of the positions. This site's calculator runs a self-hosted ephemeris — no external astronomy API, nothing fetched from anyone else's server — and computes the Sun's and Moon's geocentric longitudes directly, then converts them to the sidereal frame with the Lahiri ayanamsha. The five limbs follow from the table above.

Finding the exact minute a tithi ends: bisection

Knowing the tithi now is easy. Knowing the minute it ends — the number every muhurat on this site depends on — is a search problem. The elongation crosses each 12-degree boundary exactly once, so the engine brackets the crossing between two moments when the tithi is known to be different, then halves the interval and checks again. And again.

Forty-two halvings is what this site's engine does. Two to the power of forty-two is about 4.4 trillion, so an interval that starts a day wide ends up far below one second wide. That is what "sub-second accuracy" means when we say it: not a marketing rounding, a count of iterations. The same bisection finds nakshatra and yoga endings, and the sunrise-to-sunrise checks that festival rules need.

Sunrise is a place, not a time

A festival day is rarely decided by the tithi alone. It is decided by which tithi is running at a specific local moment — for most festivals, sunrise; for Diwali, the Pradosh period after sunset; for Bhai Dooj, the afternoon.

Sunrise itself has a definition, and it is not "when it gets light". The computed sunrise is when the Sun's upper limb crosses the horizon, with the Sun's centre about 50 arc-minutes below it — roughly 34 for atmospheric refraction bending the light, 16 for the Sun's own radius. It depends on latitude and longitude, so this site's engine works it out for each city — over ninety of them in the calculator — rather than borrowing a national average.

This single fact explains most of what confuses people about festival dates abroad. The tithi is one absolute event, the same instant everywhere on Earth. But the sunrise that judges it happens at a different moment in every city, sometimes with a different tithi standing in front of it. In 2026 that is exactly why Govardhan Puja is Tuesday morning in Delhi and Monday in New York — and Monday afternoon in Berlin, where Pratipada arrives after sunrise and the observance falls to the evening window. Same sky. Different sunrise. Different day. Nobody made an arithmetic error, and nobody's grandmother's panchang is broken.

Some festivals make the locality impossible to dodge. Chhath is offered to the visible sun at your own horizon — your sunset, your sunrise, nobody else's — which is why its dates hold worldwide while its times scatter across the clock. And Dev Diwali rides on whether your city's dusk falls inside Kartik Purnima, which is how London ends up a day ahead of Varanasi in 2026.

The awkward cases the rules exist for

A calendar that only had to handle normal days would be a pamphlet. The real rules earn their keep on the awkward ones:

Ekadashi is the strictest. The fast day is not simply "the day Ekadashi is running" — it is judged across consecutive sunrises, with rules for when Dashami leaks into the pre-dawn (the viddha question) and when Ekadashi spans two sunrises and the observance goes to the second. The engine evaluates the tithi at each relevant sunrise rather than picking the nearest day and hoping.

Adhika and kshaya tithis — a tithi that spans two sunrises, or one that begins and ends between two — bend month lengths and occasionally swallow or duplicate a festival. Adhika Maas, the leap month, arrives when a lunar month contains no solar ingress; it is why the festival calendar breathes against the solar year instead of drifting away from it like a purely lunar calendar does.

Amanta and Purnimanta are the two ways of naming the same months: new moon to new moon in most of the South and West, full moon to full moon in much of the North. Same tithis, same sky — the month's name-tag is pinned to a different end. The Panchang Calculator shows the day's elements directly, so the naming convention stops mattering the moment you look at the tithi itself.

Check the machine yourself

None of this asks to be taken on trust; that is rather the point of publishing the method. Open the Indian Vrat & Festivals Calculator, choose your city, and look at today's tithi and its ending time. Compare the sunrise against any weather service. If you keep dates in both calendars, the Hindu Date Converter runs the same engine in the other direction.

And when a date on this site surprises you — a festival a day early in Berlin, an arghya at a strange hour in Moscow — the explanation is almost never a typo. It is the two numbers and your sunrise, doing exactly what the Surya Siddhanta's authors would have recognised, just counted faster.


This engine and these rules produced every date in the site's Kartik 2026 series — Diwali, Govardhan Puja, Bhai Dooj, Chhath Puja and Dev Diwali — including the disagreements between cities, which are documented in those articles rather than smoothed over.

Photos via Wikimedia Commons: Jantar Mantar, Jaipur (CC BY-SA); total solar eclipse (CC BY-SA); crescent moon (CC0); Milky Way (public domain); astrolabe (CC BY); a ghat on the Ganga at Varanasi (CC BY).

Frequently Asked Questions

Why do two panchangs sometimes give different dates?
Usually the ayanamsha (Lahiri vs Raman vs others), sometimes a different sunrise convention or festival rule. A degree of ayanamsha difference can move a tithi ending across a sunrise and flip the day. This site uses Lahiri, the Indian government calendar's standard.
What is ayanamsha, in one sentence?
The current gap — about 24 degrees and growing by roughly 50 arc-seconds a year — between the tropical zodiac measured from the equinox and the sidereal zodiac measured from the stars.
How accurate are the times on this site?
The engine finds tithi and nakshatra transitions by 42-iteration bisection, which resolves them to below one second. Printed panchangs commonly differ by a few minutes because of rounding and different ephemerides; if your temple announces a time, the temple wins.
Why did a festival fall on a different day in my country?
Because the festival day is decided by the tithi running at your local sunrise (or sunset), and your sunrise is hours away from India's. The tithi itself is one worldwide event; the day it lands on is local.
Does the calculator need my location's data from a server?
No. The ephemeris is self-hosted and the calculations run without an external astronomy API. Your city supplies latitude, longitude and sunrise; the sky is computed, not fetched.
#how panchang is calculated #Panchang #Surya Siddhanta #Ayanamsha #Tithi #Astronomy