# Tithi, karana and yoga from Sun and Moon longitudes

> Three of the five panchang limbs are pure arithmetic on two numbers. Give the Sun's and Moon's longitudes - from any endpoint or ephemeris - and the tool returns what [`POST /v1/panchang`](https://astronode.dev/capabilities/vedic/panchang) would report for that moment, with how far into each limb the moment falls.

Source: https://astronode.dev/tools/tithi-calculator · Updated: 2026-12-04

The interactive tool runs in the browser at https://astronode.dev/tools/tithi-calculator; this file is its explanation.

## Three rules

*How the engine computes each limb*

| Limb | Angle | Rule |
| --- | --- | --- |
| Tithi 1-30 | Moon - Sun (0-360°) | `floor(angle / 12) + 1`; 1-15 Shukla, 16-30 Krishna; 15 is Purnima, 30 Amavasya |
| Karana 1-60 | Moon - Sun | `floor(angle / 6) + 1`; 1 Kimstughna, 2-57 cycle Bava, Balava, Kaulava, Taitila, Garaja, Vanija, Vishti; 58-60 Shakuni, Chatushpada, Naga |
| Yoga 1-27 | Sun + Moon (0-360°) | `floor(angle / 13°20′) + 1`, Vishkambha to Vaidhriti |

Names are the engine's own tables; the full lists, with nakshatra and vara, are in the [panchang elements reference](https://astronode.dev/reference/panchang-elements).

## Which zodiac? Only the yoga cares

Converting tropical to sidereal subtracts the same ayanamsa from the Sun and the Moon, so **Moon - Sun is identical in both zodiacs**: tithi and karana come out the same whatever you feed in. **Sun + Moon** loses the ayanamsa twice - about 48.5° in 2026, three and a half yogas - so the yoga depends on the zodiac. The engine uses the **sidereal (Lahiri)** sum, from Swiss Ephemeris' sidereal mode. Choose "Tropical" in the tool and give the moment, and it subtracts twice the mean Lahiri ayanamsa first; because the engine's sidereal mode also removes nutation, that sum can differ from the engine's by up to about 37″, which matters only right at a yoga boundary.

## Worked example from a recorded panchang

The playground's panchang request (12 May 2026, 31.7473 N 77.7754 E, IST) is evaluated at sunrise, 2026-05-11T23:54:28Z. The sidereal Sun is then **27.0647°** and the Moon **322.1667°**:

- Moon - Sun = 295.1020° → 295.1020 / 12 = 24.59 → **tithi 25, Krishna Dashami**, 7.10° in, 4.90° to go.
- 295.1020 / 6 = 49.18 → **karana 50**: (50 - 2) mod 7 = 6 → **Vishti**.
- Sun + Moon = 349.2315° → 349.2315 / 13.3333 = 26.19 → **yoga 27, Vaidhriti**.

The recorded response has exactly those three. Fed the **tropical** longitudes of the same instant (51.2917° and 346.3937°), the tithi and karana stay the same but the raw sum gives yoga 3, Ayushman - the wrong answer for a Vedic panchang. At 200 sunrises across 1950-2100 and ten cities, the tool and the engine agree on all three limbs every time.

## Common mistakes

- **Reading the tithi at the wrong moment.** The API evaluates at local sunrise; a tithi lasts roughly 20 to 26 hours, so the one at noon may differ. The response's `tithi.start` and `tithi.end` give the actual span - see [panchang sunrise conventions](https://astronode.dev/guides/panchang-sunrise-conventions).
- **Expecting tithi names to be unique.** Pratipada to Chaturdashi occur in both pakshas; use the index or the paksha.
- **Confusing the panchang yoga with chart yogas.** This is the Sun + Moon limb, not a planetary combination from [`POST /v1/yogas`](https://astronode.dev/capabilities/vedic/yogas).
- **Feeding tropical sums into the yoga.** See above.

## FAQ

**Why are there only 11 karana names for 60 karanas?**

Seven movable karanas repeat eight times through slots 2-57; four fixed ones take slot 1 and slots 58-60, around the new moon.

**Can I get the moment a tithi ends from this tool?**

No - that needs the Sun's and Moon's motion. The API solves for it and returns `tithi.start` and `tithi.end` as UTC instants.

**Does the ayanamsa choice change the tithi?**

No: Lahiri, KP or tropical, the difference Moon - Sun is the same. Only the yoga moves.

## Related endpoints

- [`POST /v1/panchang`](https://astronode.dev/capabilities/vedic/panchang) - Panchang API
- [`POST /v1/muhurta/auspicious`](https://astronode.dev/capabilities/vedic/muhurta-auspicious) - Auspicious Muhurta (Abhijit, Amrit Kaal) API
- [`POST /v1/charts/birth`](https://astronode.dev/capabilities/vedic/charts-birth) - Birth Chart (Kundli) API
