about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--structs_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/structs_test.go b/structs_test.go
index 5b00aa5..ae4ed35 100644
--- a/structs_test.go
+++ b/structs_test.go
@@ -127,7 +127,24 @@ func TestInsert(t *testing.T) {
 	t.Logf("Complete Tree: %v\n", newQuadtree.northEast.southWest.southWest.northEast)
 }
 
+// Example demonstrating the NewCoord() function
 func ExampleNewCoord() {
 	fmt.Println(NewCoord(1, 1))
 	// Output: {1, 1}
 }
+
+// Example demonstrationg the NewBoundingBox() function
+func ExampleNewBoundingBox() {
+	fmt.Println(NewBoundingBox(NewCoord(0, 0), 10))
+	// Output: {{0, 0}, 10}
+}
+
+// Example using the InsideOf() method to test if a point is inside of a quadtre-cell
+func ExampleInsideOf() {
+	var point Coord = NewCoord(0, 0)
+	var bounadry BoundingBox = NewBoundingBox(NewCoord(0, 0), 10)
+	var quadtreeCell *Quadtree = NewQuadtree(bounadry, 0)
+
+	fmt.Println(point.InsideOf(quadtreeCell))
+	// Output: true
+}