From 9980713b96ede448e90a0d285356c42901d59f7b Mon Sep 17 00:00:00 2001 From: hanemile Date: Sat, 3 Nov 2018 17:48:03 +0100 Subject: Moved the BoundingBox struct to the top of the file. --- structs.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'structs.go') 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) -- cgit 1.4.1