refactor(constants): centralize magic constants from functionals (N4/N6 audit)
- Add LOG_EDGE_LENGTH_FLOOR (-30.0) for degenerate edge handling - Add HYPER_IDEAL_SCALE_FLOOR (0.01) for negative-scale clamping - Add ASIN_DOMAIN_GUARD (1.0 - 1e-15) for asin argument bounding - Each constant is documented with rationale and units - Update 4 usage sites: euclidean_functional, hyper_ideal_functional, spherical_functional, spherical_geometry - Add constants.hpp include to hyper_ideal_functional and spherical_functional 282/282 tests pass. Addresses N4 (unnamed magic constants) and N6 (centralize tolerances) from numerical-stability audit. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -162,7 +162,7 @@ inline void compute_euclidean_lambda0_from_mesh(ConformalMesh& mesh, EuclideanMa
|
||||
if (len > 1e-15)
|
||||
m.lambda0[e] = 2.0 * std::log(len);
|
||||
else
|
||||
m.lambda0[e] = -30.0; // degenerate edge
|
||||
m.lambda0[e] = LOG_EDGE_LENGTH_FLOOR; // degenerate edge
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user