First ecliptic longitude in degrees
Second ecliptic longitude in degrees
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)
Calculate the angular separation between two ecliptic longitudes.