about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2018-11-03 17:48:03 +0100
committerhanemile <hanemile@protonmail.com>2018-11-03 17:48:03 +0100
commit9980713b96ede448e90a0d285356c42901d59f7b (patch)
tree9a9c14ca8c60a5ea89fde7dd53aa344c67645c2c
parent62b9bd50e785f52e2692624ffc04299e731048b7 (diff)
Moved the BoundingBox struct to the top of the file.
-rw-r--r--structs.go20
1 files changed, 6 insertions, 14 deletions
diff --git a/structs.go b/structs.go
index 38ed84c..2d7f6a9 100644
--- a/structs.go
+++ b/structs.go
@@ -6,6 +6,12 @@ type Coord struct {
 	y float64
 }
 
+// BoundingBox defines a single cell in the quadtree
+type BoundingBox struct {
+	center        Coord
+	halfDimension float64
+}
+
 // newCoord returns a new coordinate using the given values
 func NewCoord(x float64, y float64) Coord {
 	return Coord{x, y}
@@ -33,20 +39,6 @@ func (point Coord) insideOf(quadtreeCell *quadtree) bool {
 	return false
 }
 
-// BoundingBox defines a single cell in the quadtree
-type BoundingBox struct {
-	center        Coord
-	halfDimension float64
-}
-
-// NewBoundingBox returns a new bounding with the given struct elements
-func NewBoundingBox(inCenter Coord, inHalfDimension float64) BoundingBox {
-	return BoundingBox{
-		center:        inCenter,
-		halfDimension: inHalfDimension,
-	}
-}
-
 // quadtree defining the whole quadtree and a node in itself (recursively)
 type quadtree struct {
 	// general information (node capacity, spacial outreach)