about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2019-01-22 12:22:37 +0100
committerhanemile <hanemile@protonmail.com>2019-01-22 12:22:37 +0100
commit8181911b97bead46e36b730b94b73144ec6a8713 (patch)
treee28abb72448e2280281a7fd7107d7ff92f0f2c0c
parent751fea49ccc676ebf3377333dee03c5504edffea (diff)
increased the recursion limit
-rw-r--r--quadtree.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/quadtree.go b/quadtree.go
index 40f308e..07bbe73 100644
--- a/quadtree.go
+++ b/quadtree.go
@@ -62,8 +62,8 @@ func (n *Node) subdivide() {
 func (n *Node) Insert(star Star2D) error {
 
 	// prevent the function from recursing to deep into the tree
-	if n.Boundry.Width < 0.000001 {
-		return fmt.Errorf("Could not insert star (%f, %f)\n", star.C.X, star.C.Y)
+	if n.Boundry.Width < 0.0000000000001 {
+		return fmt.Errorf("Could not insert star (%f, %f) (recursion limit reached)\n", star.C.X, star.C.Y)
 	}
 
 	// if the subtree does not contain a node, insert the star