Skip to content

Commit ece75f6

Browse files
DocAtPromptclaude
andcommitted
Clamp the freeze-mode sun to the tropics, not the poles
The real sun never passes over the geographic poles — it stays within the tropical band of ±23.45° latitude (the obliquity of the ecliptic). Freeze mode was clamping the user-driven sun delta to ±90°, which let the user park the sun directly over the North Pole. Looked wrong. Fix: the effective subsolar latitude (live + Δ) is now clamped to ±23.45°. The Δ value itself stays free so the user can push past the boundary and pull back without surprise; the rendering simply pins to the tropic line when the sum exceeds it. The earth's axial tilt itself is, and always was, handled implicitly via sun::subsolar_point(), which returns the real ecliptic declination for the given date. Mathematically equivalent to a tilted-axis earth with a fixed-direction sun. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 44a87d2 commit ece75f6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/app.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ impl AppState {
169169
pub fn effective_sun_dir(&self, now: DateTime<Utc>) -> V3 {
170170
let base = self.freeze_anchor.unwrap_or(now);
171171
let (lat_deg, lon_deg) = sun::subsolar_point(base);
172-
let lat = (lat_deg + self.sun_delta_deg.0).clamp(-90.0, 90.0);
172+
// Sonne wandert in Wirklichkeit nur zwischen den Wendekreisen — never
173+
// over the poles. Clamp on the *effective* (live + Δ) latitude so the
174+
// user can push the Δ but never see the sun above the tropics.
175+
let lat = (lat_deg + self.sun_delta_deg.0).clamp(-23.45, 23.45);
173176
let lon = lon_deg + self.sun_delta_deg.1;
174177
// subsolar_point liefert den Subsolar im *Erd-fixed* Frame (enthält GMST).
175178
// Für Lighting brauchen wir den Vektor im *Welt-Frame* — daher um die

0 commit comments

Comments
 (0)