Celestine API Documentation - v0.2.0
    Preparing search index...

    Function eclipticToZodiac

    • Convert ecliptic longitude to zodiac position

      Takes a geocentric ecliptic longitude (0-360°) and determines which tropical zodiac sign it falls in, along with the precise degree, minute, and second within that sign.

      Algorithm (based on Swiss Ephemeris):

      1. Normalize longitude to 0-360° range
      2. Calculate sign index: floor(longitude / 30)
      3. Calculate degree within sign: longitude % 30
      4. Convert decimal degrees to degrees/minutes/seconds
      5. Handle rounding edge cases

      Parameters

      • longitude: number

        Ecliptic longitude in degrees (0-360, but accepts any value)

      Returns ZodiacPosition

      Complete zodiac position with sign, degree, and formatting

      // Simple example
      const pos = eclipticToZodiac(15.5);
      // pos.sign = Sign.Aries
      // pos.degree = 15, pos.minute = 30, pos.second = 0
      // pos.formatted = "15°30'00\" Aries"
      // Meeus Example 25.a: Venus on 1992 Oct 13
      const venus = eclipticToZodiac(217.411111);
      // venus.sign = Sign.Scorpio
      // venus.degree = 7, venus.minute = 24, venus.second = 40
      // venus.formatted = "7°24'40\" Scorpio"
      // Handles normalization
      eclipticToZodiac(360); // 0° Aries (wraps around)
      eclipticToZodiac(-1); // 29° Pisces (negative wraps backward)