AbstractEuclideanPosition

N-dimensional Euclidean position.

Parameters

<P>

actual type

Inheritors

Functions

Link copied to clipboard
open fun angleBetween(other: S): Double

Computes the angle in radians between two vectors.

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.

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.
Link copied to clipboard
open fun coerceAtLeast(minimumMagnitude: Double): S
Link copied to clipboard
open fun coerceAtMost(maximumMagnitude: Double): S
Link copied to clipboard
open fun coerceIn(minimumMagnitude: Double, maximumMagnitude: Double): S

Performs a coercion at least and at most.

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

Computes the distance between two vectors, interpreted as points in an Euclidean space. Throws IllegalArgumentException if vectors have different dimensions.

fun distanceTo(other: P): Double
Computes the distance between this position and another compatible position.
Link copied to clipboard
open fun div(other: Double): S

Division by a Double.

Link copied to clipboard
open fun dot(other: S): Double

Computes the dot product between two vectors.

Link copied to clipboard
fun equals(o: Any): Boolean
Link copied to clipboard
abstract fun fromCoordinates(coordinates: Array<Double>): S

Builds a new Vector from the provided coordinates.

Link copied to clipboard
fun get(dimension: Int): Double
The coordinate of this vector in the specified dimension relatively to the basis its space is described with.
Link copied to clipboard
abstract fun getCoordinate(dimension: Int): Double

Allows to access the value of a coordinate.

fun getCoordinate(dimension: Int): Double
Allows to access the value of a coordinate.
Link copied to clipboard
abstract fun getCoordinates(): Array<Double>

Coordinates for a Cartesian space. Implementors must guarantee that internal state is not exposed.

Allows to get the position as a Number array.
Link copied to clipboard
abstract fun getDimensions(): Int

The dimensions of the space this vector belongs to.

Link copied to clipboard
open fun getMagnitude(): NonExistentClass

Finds the magnitude of a vector.

Link copied to clipboard
open fun getZero(): S

Origin.

Link copied to clipboard
fun hashCode(): Int
Link copied to clipboard
abstract fun minus(other: Array<Double>): P

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

abstract fun minus(other: S): S

Support for subtraction. Note: the dimensions must coincide.

fun minus(other: P): P
Same as minus, with the internal representation of other.
fun minus(other: Array<Double>): P
Considers both positions as vectors, and returns the difference between this position and the passed one.
Link copied to clipboard
abstract fun normal(): S

Find the normal of a vector.

Link copied to clipboard
abstract fun normalized(): S
Link copied to clipboard
abstract fun plus(other: Array<Double>): P

Considers both positions as vectors, and sums them.

abstract fun plus(other: S): S

Support for sum. Note: the dimensions must coincide.

fun plus(other: P): P
Same as plus, with the internal representation of other.
fun plus(other: Array<Double>): P
Considers both positions as vectors, and sums them.
Link copied to clipboard
open fun resized(newLen: Double): S
Link copied to clipboard
abstract fun times(other: Double): S

Multiplication by a Double.

Link copied to clipboard
open fun toString(): String
Prints the coordinates.