about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2018-10-30 15:22:57 +0100
committerhanemile <hanemile@protonmail.com>2018-10-30 15:22:57 +0100
commit74ca6c5f87b7ca29231c3666f8bc49296559b473 (patch)
tree05be30e525aad433d0073a9a3ed81e4ca9215ac0
parentb12c570a8f9217d105a32acd439249cd307d44b0 (diff)
Bounding box adds a structure that information about a single cell in
the quadtree. (Also added some comments)
-rw-r--r--structs/structs.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/structs/structs.go b/structs/structs.go
index ad47731..6f1dd57 100644
--- a/structs/structs.go
+++ b/structs/structs.go
@@ -1,6 +1,18 @@
 package structs
 
+// coordinate type storing a position
 type coord struct {
 	x float64
 	y float64
 }
+
+// newCoord returns a new coordinate using the given values
+func newCoord(x float64, y float64) coord {
+	return coord{x, y}
+}
+
+// boundingBox defines a single cell in the quadtree
+type boundingBox struct {
+	center        coord
+	halfDimension float64
+}