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

    Function angularSeparation

    • Calculate the angular separation between two ecliptic longitudes.

      Parameters

      • lon1: number

        First ecliptic longitude in degrees

      • lon2: number

        Second ecliptic longitude in degrees

      Returns number

      Shortest arc separation in degrees (0-180)

      This function always returns the shortest arc between the two points. The order of arguments doesn't matter (separation is symmetric).

      This is the foundation for all aspect detection.

      // Simple cases
      angularSeparation(0, 90) // 90
      angularSeparation(0, 180) // 180
      angularSeparation(45, 45) // 0

      // Crossing 0°/360° boundary
      angularSeparation(350, 10) // 20
      angularSeparation(359, 1) // 2

      // Always shortest arc
      angularSeparation(0, 270) // 90 (not 270)
      angularSeparation(10, 200) // 170 (not 190)