(from: number, to: number)
| 149 | |
| 150 | // Get shortest angle difference for smooth rotation |
| 151 | function getAngleDiff(from: number, to: number): number { |
| 152 | const diff = normalizeAngle(to - from); |
| 153 | return diff > 180 ? diff - 360 : diff; |
| 154 | } |
| 155 | |
| 156 | // Calculate night overlay opacity based on time of day (0 = no overlay, 1 = full dark) |
| 157 | // Uses a smooth curve: darkest at midnight, brightest at noon |