Constructors

Properties

capacity: number

the points capacity

rectangle: Rectangle

the instance rectangle area

Methods

  • Inserts the given point in the instance, or to its subtrees

    Parameters

    • point: Point

      the point to insert

    Returns boolean

    true if the point is added to the instance or one of its subtrees, false if it's not

  • Queries the instance using a Rectangle object, with the given position and the given size

    Parameters

    • range: BaseRange

      the range to use for querying the tree

    • Optionalcheck: ((particle: Particle) => boolean)

      the function to check if the particle can be added to the result

        • (particle): boolean
        • Parameters

          Returns boolean

    Returns Particle[]

    the particles inside the given range

  • Queries the instance using a Circle object, with the given position and the given radius

    Parameters

    • position: ICoordinates

      the circle position

    • radius: number

      the circle radius

    • Optionalcheck: ((particle: Particle) => boolean)

      the function to check if the particle can be added to the result

        • (particle): boolean
        • Parameters

          Returns boolean

    Returns Particle[]

    the particles inside the given circle

  • Queries the instance using a Rectangle object, with the given position and the given size

    Parameters

    • position: ICoordinates

      the rectangle position

    • size: IDimension

      the rectangle size

    • Optionalcheck: ((particle: Particle) => boolean)

      the function to check if the particle can be added to the result

        • (particle): boolean
        • Parameters

          Returns boolean

    Returns Particle[]

    the particles inside the given rectangle