API Docs for: 0.99.4
Show:

# JXG.Math.Quadtree Class

Instantiate a new quad tree.

## Constructor

### `JXG.Math.Quadtree`

(
• `bbox`
)

#### Parameters:

• `bbox` Array

Bounding box of the new quad (sub)tree.

## Methods

### `_query`

(
• `x`
• `y`
)
Boolean | JXG.Quadtree private

Internal _query method that lacks adjustment of the parameter.

#### Returns:

Boolean | JXG.Quadtree:

The quad tree if the point is found, false if none of the quad trees contains the point (i.e. the point is not inside the root tree's AABB).

### `contains`

(
• `x`
• `y`
)

Checks if the given coordinates are inside the quad tree.

### `insert`

(
• `p`
)

Insert a new point into this quad tree.

### `query`

(
• `xp`
• `y`
)
Boolean | JXG.Quadtree private

Retrieve the smallest quad tree that contains the given point.

#### Parameters:

• `xp`
• `y` Number

#### Returns:

Boolean | JXG.Quadtree:

The quad tree if the point is found, false if none of the quad trees contains the point (i.e. the point is not inside the root tree's AABB).

### `subdivide`

()

Subdivide the quad tree.

## Properties

### `capacity`

Number

The maximum number of points stored in a quad tree node before it is subdivided.

Default: 10

### `northEast`

JXG.Quadtree

In a subdivided quad tree this represents the top right subtree.

### `northWest`

JXG.Quadtree

In a subdivided quad tree this represents the top left subtree.

Array

Point storage.

### `southEast`

JXG.Quadtree

In a subdivided quad tree this represents the bottom right subtree.

### `southWest`

JXG.Quadtree

In a subdivided quad tree this represents the bottom left subtree.