Package-level declarations

Types

Link copied to clipboard
@Serializable
data class BooleanVector2(val x: Boolean, val y: Boolean)

Boolean 2D vector

Link copied to clipboard
@Serializable
data class BooleanVector3(val x: Boolean, val y: Boolean, val z: Boolean)

Boolean 3D vector

Link copied to clipboard
@Serializable
data class BooleanVector4(val x: Boolean, val y: Boolean, val z: Boolean, val w: Boolean)

Boolean 4D vector

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object Hashes

From ztellman's Artifex library

Link copied to clipboard
@Serializable
data class IntVector2(val x: Int, val y: Int)

Integer 2D vector, exclusively for integer calculations.

Link copied to clipboard
@Serializable
data class IntVector3(val x: Int, val y: Int, val z: Int)

Integer 3D vector, exclusively for integer calculations.

Link copied to clipboard
@Serializable
data class IntVector4(val x: Int, val y: Int, val z: Int, val w: Int)

Integer 4D vector, exclusively for integer calculations.

Link copied to clipboard
class LinearRange<T : LinearType<T>>(val start: T, val end: T)
Link copied to clipboard
interface LinearType<T : LinearType<T>>
Link copied to clipboard
@Serializable
data class Matrix33(val c0r0: Double = 0.0, val c1r0: Double = 0.0, val c2r0: Double = 0.0, val c0r1: Double = 0.0, val c1r1: Double = 0.0, val c2r1: Double = 0.0, val c0r2: Double = 0.0, val c1r2: Double = 0.0, val c2r2: Double = 0.0) : LinearType<Matrix33>

A 3x3 matrix with double precision

Link copied to clipboard
@Serializable
data class Matrix44(val c0r0: Double = 0.0, val c1r0: Double = 0.0, val c2r0: Double = 0.0, val c3r0: Double = 0.0, val c0r1: Double = 0.0, val c1r1: Double = 0.0, val c2r1: Double = 0.0, val c3r1: Double = 0.0, val c0r2: Double = 0.0, val c1r2: Double = 0.0, val c2r2: Double = 0.0, val c3r2: Double = 0.0, val c0r3: Double = 0.0, val c1r3: Double = 0.0, val c2r3: Double = 0.0, val c3r3: Double = 0.0) : LinearType<Matrix44>

A 4x4 matrix with double precision

Link copied to clipboard
@Serializable
data class Matrix55(val c0r0: Double = 0.0, val c1r0: Double = 0.0, val c2r0: Double = 0.0, val c3r0: Double = 0.0, val c4r0: Double = 0.0, val c0r1: Double = 0.0, val c1r1: Double = 0.0, val c2r1: Double = 0.0, val c3r1: Double = 0.0, val c4r1: Double = 0.0, val c0r2: Double = 0.0, val c1r2: Double = 0.0, val c2r2: Double = 0.0, val c3r2: Double = 0.0, val c4r2: Double = 0.0, val c0r3: Double = 0.0, val c1r3: Double = 0.0, val c2r3: Double = 0.0, val c3r3: Double = 0.0, val c4r3: Double = 0.0, val c0r4: Double = 0.0, val c1r4: Double = 0.0, val c2r4: Double = 0.0, val c3r4: Double = 0.0, val c4r4: Double = 0.0)

A 5x5 matrix with double precision

Link copied to clipboard
@Serializable
data class Polar(val theta: Double, val radius: Double = 1.0) : LinearType<Polar>

A 2D point defined in the Polar coordinate system.

Link copied to clipboard
@Serializable
data class Quaternion(val x: Double, val y: Double, val z: Double, val w: Double)

Quaternion class for representing orientations in 3D space

Link copied to clipboard
@Serializable
data class Spherical(val theta: Double, val phi: Double, val radius: Double) : LinearType<Spherical>

Spherical coordinate. The poles (phi) are at the positive and negative y-axis. The equator starts at positive z.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class Vector2(val x: Double, val y: Double) : LinearType<Vector2> , EuclideanVector<Vector2>

Double-precision 2D vector.

Link copied to clipboard
@Serializable
data class Vector3(val x: Double, val y: Double, val z: Double) : LinearType<Vector3> , EuclideanVector<Vector3>

Double-precision 3D vector.

Link copied to clipboard
@Serializable
data class Vector4(val x: Double, val y: Double, val z: Double, val w: Double) : LinearType<Vector4> , EuclideanVector<Vector4>

Double-precision 4D vector.

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <T : LinearType<T>> bezier(x0: T, c0: T, x1: T, t: Double): T
fun bezier(x0: Double, c0: Double, x1: Double, t: Double): Double
fun bezier(x0: Vector2, c0: Vector2, x1: Vector2, t: Double): Vector2
fun bezier(x0: Vector3, c0: Vector3, x1: Vector3, t: Double): Vector3
fun <T : LinearType<T>> bezier(x0: T, c0: T, c1: T, x1: T, t: Double): T
fun bezier(x0: Double, c0: Double, c1: Double, x1: Double, t: Double): Double
fun bezier(x0: Vector2, c0: Vector2, c1: Vector2, x1: Vector2, t: Double): Vector2

fun bezier(x0: Vector3, c0: Vector3, c1: Vector3, x1: Vector3, t: Double): Vector3

Samples a single point based on the provided t value from given 3D cubic Bézier curve.

Link copied to clipboard
fun clamp(value: Double, min: Double, max: Double): Double
fun clamp(value: Int, min: Int, max: Int): Int

Returns number whose value is limited between min and max.

Link copied to clipboard
@JvmName(name = "doubleClamp")
fun Double.clamp(min: Double, max: Double): Double
@JvmName(name = "intClamp")
fun Int.clamp(min: Int, max: Int): Int

Returns IntVector2 whose value is limited between min and max per vector component.

Returns IntVector3 whose value is limited between min and max per vector component.

Returns IntVector4 whose value is limited between min and max per vector component.

Returns Vector2 whose value is limited between min and max per vector component.

Returns Vector3 whose value is limited between min and max per vector component.

Returns Vector4 whose value is limited between min and max per vector component.

Link copied to clipboard
fun derivative(x0: Double, c0: Double, x1: Double, t: Double): Double
fun derivative(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: Double): Vector2
fun derivative(p0: Vector3, p1: Vector3, p2: Vector3, p3: Vector3, t: Double): Vector3
Link copied to clipboard
Link copied to clipboard
fun linearstep(edge0: Double, edge1: Double, x: Double): Double
Link copied to clipboard
fun map(before: ClosedFloatingPointRange<Double>, after: ClosedFloatingPointRange<Double>, value: Double, clamp: Boolean = false): Double
fun map(beforeLeft: Double, beforeRight: Double, afterLeft: Double, afterRight: Double, value: Double, clamp: Boolean = false): Double

Linearly maps a value, which is given in the before domain to a value in the after domain.

Link copied to clipboard

Linearly maps a value, which is given in the before domain to a value in the after domain.

@JvmName(name = "doubleMap")
fun Double.map(beforeLeft: Double, beforeRight: Double, afterLeft: Double, afterRight: Double, clamp: Boolean = false): Double

Linearly maps a value, which is given in the before domain to a value in the after domain

fun Vector2.map(beforeLeft: Vector2, beforeRight: Vector2, afterLeft: Vector2, afterRight: Vector2, clamp: Boolean = false): Vector2
fun Vector3.map(beforeLeft: Vector3, beforeRight: Vector3, afterLeft: Vector3, afterRight: Vector3, clamp: Boolean = false): Vector3
fun Vector4.map(beforeLeft: Vector4, beforeRight: Vector4, afterLeft: Vector4, afterRight: Vector4, clamp: Boolean = false): Vector4
Link copied to clipboard
fun max(a: Vector2, b: Vector2): Vector2
fun max(a: Vector3, b: Vector3): Vector3
fun max(a: Vector4, b: Vector4): Vector4
Link copied to clipboard
fun min(a: Vector2, b: Vector2): Vector2
fun min(a: Vector3, b: Vector3): Vector3
fun min(a: Vector4, b: Vector4): Vector4
Link copied to clipboard
fun mix(left: Double, right: Double, x: Double): Double
fun mix(a: Vector2, b: Vector2, mix: Double): Vector2
fun mix(a: Vector3, b: Vector3, mix: Double): Vector3
fun mix(a: Vector4, b: Vector4, mix: Double): Vector4
Link copied to clipboard
fun mixAngle(leftAngle: Double, rightAngle: Double, x: Double): Double

Similar to mix() but assuming that 355° and 5° are 10° apart, not 350°.

Link copied to clipboard
fun mod(a: Double, b: Double): Double
fun mod(a: Float, b: Float): Float
fun mod(a: Int, b: Int): Int
fun mod(a: Long, b: Long): Long
Link copied to clipboard
fun normal(x0: Vector2, c0: Vector2, x1: Vector2, t: Double): Vector2
Link copied to clipboard
Link copied to clipboard

Similar to derivative but handles cases in which p0 and p1 coincide.

Similar to derivative but handles cases in which p0 and p1 or p2 and p3 coincide.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "doubleSaturate")
fun Double.saturate(): Double
Link copied to clipboard
Link copied to clipboard
fun smootherstep(edge0: Double, edge1: Double, x: Double): Double

Smootherstep

Link copied to clipboard
fun smoothstep(edge0: Double, edge1: Double, x: Double): Double

Smoothstep

Link copied to clipboard
@JvmName(name = "doubleSmoothstep")
fun Double.smoothstep(edge0: Double, edge1: Double): Double
Link copied to clipboard
fun smoothstepIn(edge0: Double, edge1: Double, x: Double): Double

Smoothstep

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun Double.times(m: Matrix33): Matrix33
operator fun Double.times(m: Matrix44): Matrix44
operator fun Double.times(v: Vector2): Vector2
operator fun Double.times(v: Vector3): Vector3
operator fun Double.times(v: Vector4): Vector4
operator fun Int.times(v: IntVector2): IntVector2
operator fun Int.times(v: IntVector3): IntVector3
operator fun Int.times(v: IntVector4): IntVector4