comparison pkg/octree/vertex.go @ 730:4c05bdbf8e4b

Renamed scale in Vertex to uppercase to make it public.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sat, 22 Sep 2018 22:23:21 +0200
parents b0bd242ff821
children d05bc3e34338
comparison
equal deleted inserted replaced
729:b0bd242ff821 730:4c05bdbf8e4b
67 v.Y + w.Y, 67 v.Y + w.Y,
68 v.Z + w.Z, 68 v.Z + w.Z,
69 } 69 }
70 } 70 }
71 71
72 func (v Vertex) scale(s float64) Vertex { 72 func (v Vertex) Scale(s float64) Vertex {
73 return Vertex{ 73 return Vertex{
74 s * v.X, 74 s * v.X,
75 s * v.Y, 75 s * v.Y,
76 s * v.Z, 76 s * v.Z,
77 } 77 }
98 p1, 98 p1,
99 } 99 }
100 } 100 }
101 101
102 func (l Line) Eval(t float64) Vertex { 102 func (l Line) Eval(t float64) Vertex {
103 return l[0].scale(t).Add(l[1]) 103 return l[0].Scale(t).Add(l[1])
104 } 104 }
105 105
106 func (l Line) IntersectHorizontal(h float64) Vertex { 106 func (l Line) IntersectHorizontal(h float64) Vertex {
107 t := (h - l[1].Z) / l[0].Z 107 t := (h - l[1].Z) / l[0].Z
108 return l.Eval(t) 108 return l.Eval(t)