math_test.go 336 B

123456789101112131415161718
  1. package math
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func TestGetHexDistance(t *testing.T) {
  7. var points = [][4]int32{
  8. {269, 148, 275, 148},
  9. {269, 148, 275, 151},
  10. }
  11. for _, p := range points {
  12. distance := GetPointDistance(p[0], p[1], p[2], p[3])
  13. fmt.Printf("(%d, %d) -> (%d, %d) distance: %d\n", p[0], p[1], p[2], p[3], distance)
  14. }
  15. }