diff options
-rw-r--r-- | structs.go | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/structs.go b/structs.go index 8689c7a..fa503ec 100644 --- a/structs.go +++ b/structs.go @@ -14,6 +14,24 @@ type BoundingBox struct { halfDimension float64 } +// quadtree defining the whole quadtree and a node in itself (recursively) +type quadtree struct { + // general information (node capacity, spacial outreach) + nodeCapacity int + boundary BoundingBox + + // slice storing the star coordinates + pointsSlice []Coord + + // the quadtree leaves + northWest *quadtree + northEast *quadtree + southWest *quadtree + southEast *quadtree + + depth int +} + // newCoord returns a new coordinate using the given values func NewCoord(x float64, y float64) Coord { return Coord{x, y} @@ -49,24 +67,6 @@ func (point Coord) InsideOf(quadtreeCell *quadtree) bool { return false } -// quadtree defining the whole quadtree and a node in itself (recursively) -type quadtree struct { - // general information (node capacity, spacial outreach) - nodeCapacity int - boundary BoundingBox - - // slice storing the star coordinates - pointsSlice []Coord - - // the quadtree leaves - northWest *quadtree - northEast *quadtree - southWest *quadtree - southEast *quadtree - - depth int -} - // NewQuadtree returns a new quadtree func NewQuadtree(boundary BoundingBox, depth int) *quadtree { return &quadtree{ |