Position2D

interface Position2D<P : Position2D<P>> : Position<P>

A bidimensional position.

Parameters

Inheritors

Properties

Link copied to clipboard
abstract val coordinates: DoubleArray

Allows to get the position as a Number array.

Link copied to clipboard
abstract val dimensions: Int
Link copied to clipboard
abstract val x: Double
Link copied to clipboard
abstract val y: Double

Functions

Link copied to clipboard
abstract fun boundingBox(range: Double): List<P>

Given a range, produces N coordinates, representing the N opposite vertices of the hypercube having the current coordinate as center and circumscribing the N-sphere defined by the range. In the case of two dimensional coordinates, it must return the opposite vertices of the square circumscribing the circle with center in this position and radius range.

Link copied to clipboard
abstract fun distanceTo(other: P): Double

Computes the distance between this position and another compatible position.

Link copied to clipboard
abstract override fun getCoordinate(dimension: Int): Double

Allows to access the value of a coordinate.

Link copied to clipboard
abstract operator fun minus(other: DoubleArray): P

Considers both positions as vectors, and returns the difference between this position and the passed one.

Link copied to clipboard
abstract operator fun plus(other: DoubleArray): P

Considers both positions as vectors, and sums them.