diff pkg/octree/vertex.go @ 1329:ea2143adc6d3

Named method recievers consistently to make golint happy.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 25 Nov 2018 17:05:19 +0100
parents a244b18cb916
children de09bd3b5c05
line wrap: on
line diff
--- a/pkg/octree/vertex.go	Sun Nov 25 16:26:41 2018 +0100
+++ b/pkg/octree/vertex.go	Sun Nov 25 17:05:19 2018 +0100
@@ -110,8 +110,8 @@
 	}
 }
 
-func (a Vertex) Less(b Vertex) bool {
-	return a.X < b.X || a.Y < b.Y || a.Z < b.Z
+func (v Vertex) Less(w Vertex) bool {
+	return v.X < w.X || v.Y < w.Y || v.Z < w.Z
 }
 
 func NewLine(p1, p2 Vertex) Line {
@@ -537,26 +537,26 @@
 	return false
 }
 
-func (a Vertex) Cross(b Vertex) Vertex {
+func (v Vertex) Cross(w Vertex) Vertex {
 	return Vertex{
-		a.Y*b.Z - a.Z*b.Y,
-		a.Z*b.X - a.X*b.Z,
-		a.X*b.Y - a.Y*b.X,
+		v.Y*w.Z - v.Z*w.Y,
+		v.Z*w.X - v.X*w.Z,
+		v.X*w.Y - v.Y*w.X,
 	}
 }
 
-func (p1 Plane2D) Intersection(p2 Plane2D) (float64, float64, bool) {
+func (p Plane2D) Intersection(o Plane2D) (float64, float64, bool) {
 
-	u1 := Vertex{p1.A, p1.B, p1.C}
-	u2 := Vertex{p2.A, p2.B, p2.C}
+	u1 := Vertex{p.A, p.B, p.C}
+	u2 := Vertex{o.A, o.B, o.C}
 
-	p := u1.Cross(u2)
+	plane := u1.Cross(u2)
 
-	if p.Z == 0 {
+	if plane.Z == 0 {
 		return 0, 0, false
 	}
 
-	return p.X / p.Z, p.Y / p.Z, true
+	return plane.X / plane.Z, plane.Y / plane.Z, true
 }
 
 type VerticalLine struct {