fix(mathutil): preserve distances at extreme scales (#360)

This commit is contained in:
Yusuf Efe authored and GitHub committed 2026-10-23 22:43:47 +08:00
1 parent ec11fdf345
commit 9b0a0caa75
2 files changed
+10 -5

No files matched your search

+9
View File
@@ -334,6 +334,15 @@ func TestRadianToAngle(t *testing.T) {
assert.Equal(float64(45), result3)
}
func TestPointDistanceExtremeScales(t *testing.T) {
for _, scale := range []float64{1e200, 1e-200} {
got := PointDistance(0, 0, 3*scale, 4*scale)
if math.Abs(got/(5*scale)-1) > 1e-15 {
t.Errorf("scale %g: got %g, want %g", scale, got, 5*scale)
}
}
}
func TestPointDistance(t *testing.T) {
t.Parallel()