blob: 38d403d4f6b75597743a0ffc83bc32cb15057c44 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package planar
import (
"testing"
"github.com/paulmach/orb"
)
func TestDistance(t *testing.T) {
p1 := orb.Point{0, 0}
p2 := orb.Point{3, 4}
if d := Distance(p1, p2); d != 5 {
t.Errorf("point, distanceFrom expected 5, got %f", d)
}
if d := Distance(p2, p1); d != 5 {
t.Errorf("point, distanceFrom expected 5, got %f", d)
}
}
|