Phase 0: fix typecheck, format, build; remove stray emit; pin port via env
CI / Lint, typecheck, test, build (push) Failing after 22s
CI / Lint, typecheck, test, build (push) Failing after 22s
This commit is contained in:
@@ -41,13 +41,8 @@ export function shadowFraction(
|
||||
const perpDist = Math.hypot(px, py, pz);
|
||||
|
||||
if (perpDist >= occluderRadius) return 0;
|
||||
// Approximate chord length through the occluder disc
|
||||
const halfChord = Math.sqrt(occluderRadius * occluderRadius - perpDist * perpDist);
|
||||
// Approximate the angular size of the sun as seen from the occluder
|
||||
// vs the angular size of the occluder; we use 1.0 for the sun
|
||||
// (i.e. effectively point source) — good enough for visualization.
|
||||
// For a "fraction in shadow" treat the occluder disc as fully shadowing
|
||||
// when perpDist + halfChord reaches the observer; that simplifies to
|
||||
// perpDist < occluderRadius which we already check.
|
||||
return Math.min(1, 1 - perpDist / occluderRadius);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user