VectorUtil

Utility for vector operations.

Functions

Link copied to clipboard
fun calculateAngle(dotProduct: Double, norm1: Double, norm2: Double, angleUnit: AngleUnit): Double

Calculates the angle between two vectors using the dot product and their norms.

Link copied to clipboard

Computes the linear combination a1 * b1 + a2 * b2 of two pairs of doubles.

fun linearCombination(a1: Double, b1: Double, a2: Double, b2: Double, a3: Double, b3: Double): Double

Computes the linear combination a1 * b1 + a2 * b2 + a3 * b3 of three pairs of doubles.

Link copied to clipboard
fun norm(x: Double, y: Double): Double

Computes the Euclidean norm (magnitude) of a vector defined by its x and y components.

fun norm(x: Double, y: Double, z: Double): Double

Computes the Euclidean norm (magnitude) of a vector defined by its x, y, and z components.