AbstractPosition

abstract class AbstractPosition<P : Position<P>?> : Position<P>

N-dimensional position.

Parameters

<P>

actual type

Inheritors

Functions

Link copied to clipboard
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.
Link copied to clipboard
fun distanceTo(@Nonnull other: P): Double
Computes the distance between this position and another compatible position.
Link copied to clipboard
fun equals(o: Any): Boolean
Link copied to clipboard
fun getCoordinate(dimension: Int): Double
Allows to access the value of a coordinate.
Link copied to clipboard
Allows to get the position as a Number array.
Link copied to clipboard
Link copied to clipboard
fun hashCode(): Int
Link copied to clipboard
fun minus(@Nonnull other: P): P
Same as minus, with the internal representation of others.
fun minus(@Nonnull other: Array<Double>): P
Considers both positions as vectors, and returns the difference between this position and the passed one.
Link copied to clipboard
fun plus(@Nonnull other: P): P
Same as plus, with the internal representation of others.
fun plus(@Nonnull other: Array<Double>): P
Considers both positions as vectors, and sums them.
Link copied to clipboard
open fun toString(): String
Prints the coordinates.