Modern Apps git

← Modern-Apps.git

astronomy: update horizon-culling test for below-horizon visibility

Commit
840a4a8095af50d4170316124f2a1be68d808d97
Author
Vayun Mathur <[email protected]>
When
2026-11-06 05:27 UTC (1 month ago)
Parents
24ef31a
StereographicProjection now keeps below-horizon objects visible and only culls outside the
screen-corner disk; assert that instead of the old horizon cull.

Diff

astronomy/src/test/java/com/vayunmathur/astronomy/domain/projection/ProjectionTest.kt
diff --git a/astronomy/src/test/java/com/vayunmathur/astronomy/domain/projection/ProjectionTest.kt b/astronomy/src/test/java/com/vayunmathur/astronomy/domain/projection/ProjectionTest.ktindex 43de08c60a..2912e3ab41 100644--- a/astronomy/src/test/java/com/vayunmathur/astronomy/domain/projection/ProjectionTest.kt+++ b/astronomy/src/test/java/com/vayunmathur/astronomy/domain/projection/ProjectionTest.kt@@ -60,9 +60,14 @@ class ProjectionTest {     fun stereographic_horizon_culling() {         val vs = ViewState(0.0, (30.0).toRad(), 60f, 1080f, 1920f)         val proj = StereographicProjection(vs)-        val below = AltAz(0.0, (-5.0).toRad())-        assertTrue(!proj.isVisible(below))-        assertTrue(proj.project(below) == null)+        // Below-horizon objects stay visible while they are on screen.+        val belowInView = AltAz(0.0, (-5.0).toRad())+        assertTrue(proj.isVisible(belowInView))+        assertTrue(proj.project(belowInView) != null)+        // Only points outside the screen-corner disk are culled.+        val behind = AltAz((180.0).toRad(), (-5.0).toRad())+        assertTrue(!proj.isVisible(behind))+        assertTrue(proj.project(behind) == null)     }      @Test