NFW Fermat potential and physics-led viewport upgrade - #1
Open
Biswajit1999 wants to merge 35 commits into
Open
Biswajit1999 wants to merge 35 commits into
Biswajit1999 wants to merge 35 commits into
Conversation
Biswajit1999
marked this pull request as ready for review
June 28, 2026 08:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
This draft turns the former NFW/Fermat limitation into a validated circular thin-lens component, then improves interaction feedback without adding decorative pseudo-physics to the viewport.
Physics contract
For
x = r / theta_s, the implementation evaluates the standard piecewise circular-NFW functions with stable small-radius branches:alpha = 4 kappa_s theta_s g(x) / xpsi = 2 kappa_s theta_s^2 h(x)The TypeScript and Python checks use central finite differences to verify
grad(psi) = alphabelow, around, and above the scale radius. Extra guards cover the halo-centre series and the scale-radius transition.Rendering and interaction
theta -> beta(theta)from the shared physics core.Boundaries
This is a circular thin-lens NFW component, not elliptical NFW, multi-plane coupling, or inference-grade time-delay cosmography.