cmd: send group

This commit is contained in:
Ilia Denisov
2026-01-04 21:43:16 +02:00
parent c6e1cb5cdf
commit a6093a1c29
12 changed files with 266 additions and 15 deletions
+16
View File
@@ -0,0 +1,16 @@
package util
import "math"
func ShortDistance(w, h uint32, x1, y1, x2, y2 float64) float64 {
dx := math.Abs(x2 - x1)
dy := math.Abs(y2 - y1)
if dx > float64(w/2) {
dx = float64(h) - dx
}
if dy > float64(h/2) {
dy = float64(h) - dy
}
return math.Sqrt(math.Pow(dx, 2) + math.Pow(dy, 2))
}