Class Tithi

Tithi Calculation Utilities

Constructors

Methods

  • Adjust the longitude based on the time adjustment for nepal.

    Parameters

    • longitude: number

      Longitude to adjust

    • timeAdjustment: number

      Time adjustment in hours

    Returns number

    Adjusted longitude

  • Calculate the Tithi for a given Gregorian date and longitude.

    Parameters

    • year: number

      Gregorian year

    • month: number

      Gregorian month (1-12)

    • day: number

      Gregorian day (1-31)

    • longitude: number = 86.25

      Longitude for calculation (default: 86.25)

    Returns { paksha: string; tithi: string }

    Object containing the tithi name and paksha

  • Calculate Julian Date from Gregorian date.

    Parameters

    • year: number

      Gregorian year

    • month: number

      Gregorian month (1-12)

    • day: number

      Gregorian day (1-31)

    Returns number

    Julian date

  • Calculate the moon's longitude at a given time.

    Parameters

    • t: number

      Julian centuries since J2000

    Returns number

    Moon's longitude in degrees

  • Get the Paksha based on the Tithi index.

    Parameters

    • tithiIndex: number

      Index of the Tithi (0-29)

    Returns string

    Name of the Paksha ("शुक्ल" or "कृष्ण")

  • Calculate the sun's longitude at a given time.

    Parameters

    • t: number

      Julian centuries since J2000

    Returns number

    Sun's longitude in degrees

  • Get the name of the Tithi based on its index.

    Parameters

    • tithiIndex: number

      Index of the Tithi (0-29)

    Returns string

    Name of the Tithi