Vec1

data class Vec1(val x: Double) : Spatial, Distanceable<Vec1> , Vector<Vec1> (source)

This data class represents one-dimensional vectors and points in a Euclidean space.

Constructors

Link copied to clipboard
constructor(x: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val x: Double

The x-coordinate of the vector.

Functions

Link copied to clipboard
open override fun angle(other: Vec1, angleUnit: AngleUnit): Double

Calculate the angle between this vector and another vector.

Link copied to clipboard
open override fun dimensions(): Int

Returns the number of dimensions of the spatial object.

Link copied to clipboard
open infix override fun distance(other: Vec1): Double

Compute the distance to another point.

Link copied to clipboard
open infix override fun dot(other: Vec1): Double

Calculate the dot product of this vector with another vector.

Link copied to clipboard
fun eq(other: Vec1, equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): Boolean

Checks if two vectors are equal within a specified tolerance.

Link copied to clipboard
open override fun isFinite(): Boolean

Returns true if all values in the spatial are finite.

Link copied to clipboard
open override fun isInfinite(): Boolean

Returns true if any value in the spatial is infinite.

Link copied to clipboard
open override fun isNaN(): Boolean

Returns true if any value in the spatial is NaN (Not a Number).

Link copied to clipboard
fun isZero(equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): Boolean

Checks if the vector is a zero vector within a specified tolerance.

Link copied to clipboard
fun lerp(other: Vec1, t: Double): Vec1

Performs linear interpolation between two vectors.

Link copied to clipboard
open operator override fun minus(other: Vec1): Vec1

Subtracts another vector from this vector.

Link copied to clipboard
open override fun norm(): Double

Calculates the norm (magnitude) of the vector.

Link copied to clipboard
open override fun normalize(): Vec1

Normalizes the vector.

Link copied to clipboard

Calculates the squared norm of the vector.

Link copied to clipboard
open operator override fun plus(other: Vec1): Vec1

Add a vector to this vector.

Link copied to clipboard
open operator override fun times(scalar: Double): Vec1

Scale this vector by a scalar value.

Link copied to clipboard
open operator override fun unaryMinus(): Vec1

Negates the vector, flipping its direction.

Link copied to clipboard
open override fun zero(): Vec1

Get Zero vector.