Constructors

Link copied to clipboard
constructor(xp: Double, yp: Double)
constructor(c: DoubleArray)

Types

Link copied to clipboard
object Companion

Constant values and utility methods for Euclidean2DPosition.

Properties

Link copied to clipboard
open val asAngle: Double

Computes the angle with atan2(y, x).

Link copied to clipboard
override val coordinates: DoubleArray
Link copied to clipboard
override val dimensions: Int
Link copied to clipboard
open val magnitude: <Error class: unknown class>

Finds the magnitude of a vector.

Link copied to clipboard
open override val x: Double
Link copied to clipboard
open override val y: Double
Link copied to clipboard
open override val zero: Euclidean2DPosition

Origin.

Functions

Link copied to clipboard

Computes the angle in radians between two vectors.

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

Performs a coercion at least and at most.

Link copied to clipboard
override fun distanceTo(other: Euclidean2DPosition): Double

Computes the distance between this position and another compatible position.

Link copied to clipboard
open operator override fun div(other: Double): Euclidean2DPosition

Division by a Double.

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

Computes the dot product between two vectors.

Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun fromCoordinates(coordinates: DoubleArray): Euclidean2DPosition

Builds a new Vector from the provided coordinates.

Link copied to clipboard
operator override fun get(dim: Int): Double

The coordinate of this vector in the specified dimension relatively to the basis its space is described with.

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

Allows to access the value of a coordinate.

Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
open fun isInRectangle(origin: Vector2D<*>, width: Double, height: Double): Boolean

Checks whether the given point is inside a rectangular region described by an origin point and width and height values (only positive).

Link copied to clipboard

Same as minus, with the internal representation of other.

operator override fun minus(other: DoubleArray): Euclidean2DPosition

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

Link copied to clipboard
open override fun newFrom(x: Double, y: Double): Euclidean2DPosition

Creates a new Vector2D with the same type of the current one with different x and y.

Link copied to clipboard
open override fun normal(): Euclidean2DPosition

Find the normal of a vector.

Link copied to clipboard
Link copied to clipboard

Same as plus, with the internal representation of other.

operator override fun plus(other: DoubleArray): Euclidean2DPosition

Considers both positions as vectors, and sums them.

Link copied to clipboard
Link copied to clipboard
open fun surrounding(radius: Double, count: Int = 12): List<Euclidean2DPosition>

Creates a list of count points equally spaced in the circle of given radius with center in this vector.

Link copied to clipboard

Computes a point which is at a certain distance and angle (expressed as a versor centered in this node) from this one.

Computes a point which is at a certain distance and angle (in radians) from this one.

Link copied to clipboard
open operator override fun times(other: Double): Euclidean2DPosition

Multiplication by a Double.

Link copied to clipboard
open override fun toString(): String

Prints the coordinates.