Mercurial > gemma
diff pkg/octree/vertex.go @ 4554:23236657b032 iso-areas
Use Sub2D in triangles 2D contains.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 01 Oct 2019 14:51:20 +0200 |
parents | aa2d0006e742 |
children | c91e759007da |
line wrap: on
line diff
--- a/pkg/octree/vertex.go Tue Oct 01 13:40:01 2019 +0200 +++ b/pkg/octree/vertex.go Tue Oct 01 14:51:20 2019 +0200 @@ -350,9 +350,9 @@ } func (t *Triangle) Contains(x, y float64) bool { - v0 := t[2].Sub(t[0]) - v1 := t[1].Sub(t[0]) - v2 := Vertex{X: x, Y: y}.Sub(t[0]) + v0 := t[2].Sub2D(t[0]) + v1 := t[1].Sub2D(t[0]) + v2 := Vertex{X: x, Y: y}.Sub2D(t[0]) dot00 := v0.Dot2(v0) dot01 := v0.Dot2(v1)