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

+1 -5
View File
@@ -299,11 +299,7 @@ func RadianToAngle(radian float64) float64 {
// PointDistance get two points distance.
// Play: https://go.dev/play/p/RrG4JIaziM8
func PointDistance(x1, y1, x2, y2 float64) float64 {
a := x1 - x2
b := y1 - y2
c := math.Pow(a, 2) + math.Pow(b, 2)
return math.Sqrt(c)
return math.Hypot(x1-x2, y1-y2)
}
// IsPrime checks if number is prime number.