Vector

interface Vector<V : Vector<V>>(source)

This interface represents a vector in a multi-dimensional space.

Inheritors

Functions

Link copied to clipboard
abstract fun angle(other: V, angleUnit: AngleUnit = AngleUnit.RADIANS): Double

Calculate the angle between this vector and another vector.

Link copied to clipboard
abstract infix fun distance(other: V): Double

Calculate the distance between this vector and another vector.

Link copied to clipboard
abstract infix fun dot(other: V): Double

Calculate the dot product of this vector with another vector.

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

Subtracts another vector from this vector.

Link copied to clipboard
abstract fun norm(): Double

Calculates the norm (magnitude) of the vector.

Link copied to clipboard
abstract fun normalize(): V

Normalizes the vector.

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

Add a vector to this vector.

Link copied to clipboard
abstract operator fun times(scalar: Double): V

Scale this vector by a scalar value.

Link copied to clipboard
abstract operator fun unaryMinus(): V

Negates the vector, flipping its direction.

Link copied to clipboard
abstract fun zero(): V

Get Zero vector.