Package-level declarations

Types

Link copied to clipboard
value class Matrix3d(val m00: Double, val m01: Double, val m02: Double, val m10: Double, val m11: Double, val m12: Double, val m20: Double, val m21: Double, val m22: Double)

Immutable row-major 3x3 matrix multiplying column vectors.

Link copied to clipboard
value class Matrix3f(val m00: Float, val m01: Float, val m02: Float, val m10: Float, val m11: Float, val m12: Float, val m20: Float, val m21: Float, val m22: Float)

Immutable row-major 3x3 matrix multiplying column vectors.

Link copied to clipboard
value class Matrix4d(val m00: Double, val m01: Double, val m02: Double, val m03: Double, val m10: Double, val m11: Double, val m12: Double, val m13: Double, val m20: Double, val m21: Double, val m22: Double, val m23: Double, val m30: Double, val m31: Double, val m32: Double, val m33: Double)

Immutable 4x4 matrix with row/column-named components, in row-major constructor order. Multiplies column vectors: (a * b) * point applies b first. Use identity() for the identity matrix.

Link copied to clipboard
value class Matrix4f(val m00: Float, val m01: Float, val m02: Float, val m03: Float, val m10: Float, val m11: Float, val m12: Float, val m13: Float, val m20: Float, val m21: Float, val m22: Float, val m23: Float, val m30: Float, val m31: Float, val m32: Float, val m33: Float)

Immutable 4x4 matrix with row/column-named components, in row-major constructor order. Multiplies column vectors: (a * b) * point applies b first. Use identity() for the identity matrix.

Link copied to clipboard
typealias Position2f = Vector2f

A position expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
typealias Position2i = Vector2i

A position expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
typealias Position3f = Vector3f

A position expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
typealias Position3i = Vector3i

A position expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
value class Quaterniond(val x: Double, val y: Double, val z: Double, val w: Double)

Immutable quaternion components in x, y, z, w order, distinct from a four-dimensional vector. Construction and conversion preserve components; they do not normalize or validate a rotation.

Link copied to clipboard
value class Quaternionf(val x: Float, val y: Float, val z: Float, val w: Float)

Immutable quaternion components in x, y, z, w order, distinct from a four-dimensional vector. Construction and conversion preserve components; they do not normalize or validate a rotation.

Link copied to clipboard
value class Rect2f(val position: Position2f, val size: Size2f)

Half-open rectangle: left/top included, right/bottom excluded. Zero-sized rectangles are empty.

Link copied to clipboard
value class Rect2i(val position: Position2i, val size: Size2i)

Half-open rectangle: left/top included, right/bottom excluded. Zero-sized rectangles are empty.

Link copied to clipboard
value class Rotation3d

Spatial rotation with unit length up to Double rounding. Factories validate and normalize input. Uses right-handed active rotations of column vectors; a * b applies b first.

Link copied to clipboard
value class Rotation3f

Spatial rotation with unit length up to Float rounding. Factories validate and normalize input. Uses right-handed active rotations of column vectors; a * b applies b first.

Link copied to clipboard
typealias Size2f = Vector2f

A size expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
typealias Size2i = Vector2i

A size expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
typealias Size3f = Vector3f

A size expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
typealias Size3i = Vector3i

A size expressed as a vector; this alias adds no distinct type or validation.

Link copied to clipboard
value class Vector2d(val x: Double, val y: Double)

Immutable 2D Double vector. Arithmetic follows Double semantics.

Link copied to clipboard
value class Vector2f(val x: Float, val y: Float)

Immutable 2D Float vector. Arithmetic follows the scalar type, including overflow and non-finite values.

Link copied to clipboard
value class Vector2i(val x: Int, val y: Int)

Immutable 2D Int vector. Arithmetic follows the scalar type, including overflow and non-finite values.

Link copied to clipboard
value class Vector3d(val x: Double, val y: Double, val z: Double)

Immutable 3D Double vector. Arithmetic follows Double semantics.

Link copied to clipboard
value class Vector3f(val x: Float, val y: Float, val z: Float)

Immutable 3D Float vector. Arithmetic follows the scalar type, including overflow and non-finite values.

Link copied to clipboard
value class Vector3i(val x: Int, val y: Int, val z: Int)

Immutable 3D Int vector. Arithmetic follows the scalar type, including overflow and non-finite values.

Link copied to clipboard
value class Vector4d(val x: Double, val y: Double, val z: Double, val w: Double)

Immutable 4D Double vector. Arithmetic follows Double semantics.

Link copied to clipboard
value class Vector4f(val x: Float, val y: Float, val z: Float, val w: Float)

Immutable homogeneous Float vector. Projection division is explicit; arithmetic follows Float semantics.

Properties

Link copied to clipboard
const val E: Double = 2.718281828459045

The base of the natural logarithm.

Link copied to clipboard
const val PI: Double = 3.141592653589793

The ratio of a circle's circumference to its diameter.

Link copied to clipboard
Link copied to clipboard

Distance to the next greater magnitude, including the smallest subnormal for zero.

Functions

Link copied to clipboard
fun abs(x: Double): Double
fun abs(x: Float): Float

fun abs(n: Int): Int
fun abs(n: Long): Long

The minimum value retains its negative value because its magnitude is not representable.

Link copied to clipboard
fun acos(x: Double): Double
fun acos(x: Float): Float
Link copied to clipboard
fun acosh(x: Float): Float
Link copied to clipboard
fun asin(x: Double): Double
fun asin(x: Float): Float
Link copied to clipboard
fun asinh(x: Float): Float
Link copied to clipboard
fun atan(x: Double): Double
fun atan(x: Float): Float
Link copied to clipboard
fun atan2(y: Double, x: Double): Double
fun atan2(y: Float, x: Float): Float
Link copied to clipboard
fun atanh(x: Float): Float
Link copied to clipboard
infix fun Float.by(height: Float): Size2f

infix fun Int.by(height: Int): Size2i

A size-oriented synonym for xy; negative components remain valid vectors.

Link copied to clipboard
fun cbrt(x: Double): Double
fun cbrt(x: Float): Float
Link copied to clipboard
fun ceil(x: Double): Double
fun ceil(x: Float): Float
Link copied to clipboard
fun cos(x: Double): Double
fun cos(x: Float): Float
Link copied to clipboard
fun cosh(x: Double): Double
fun cosh(x: Float): Float
Link copied to clipboard
fun exp(x: Double): Double
fun exp(x: Float): Float
Link copied to clipboard
fun expm1(x: Float): Float
Link copied to clipboard
fun floor(x: Float): Float
Link copied to clipboard
fun hypot(x: Double, y: Double): Double
fun hypot(x: Float, y: Float): Float
Link copied to clipboard
fun Double.IEEErem(divisor: Double): Double
fun Float.IEEErem(divisor: Float): Float

IEEE remainder using the nearest integer quotient with ties to even; differs from %.

Link copied to clipboard
fun ln(x: Double): Double
fun ln(x: Float): Float
Link copied to clipboard
fun ln1p(x: Double): Double
fun ln1p(x: Float): Float
Link copied to clipboard
fun log(x: Double, base: Double): Double
fun log(x: Float, base: Float): Float

Logarithm in the given base; a non-positive base or a base of one produces NaN.

Link copied to clipboard
fun log10(x: Float): Float
Link copied to clipboard
fun log2(x: Double): Double
fun log2(x: Float): Float
Link copied to clipboard
fun max(a: Double, b: Double): Double
fun max(a: Float, b: Float): Float
fun max(a: Int, b: Int): Int
fun max(a: Long, b: Long): Long
Link copied to clipboard
fun min(a: Double, b: Double): Double
fun min(a: Float, b: Float): Float
fun min(a: Int, b: Int): Int
fun min(a: Long, b: Long): Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Float.pow(x: Float): Float

fun Double.pow(n: Int): Double
fun Float.pow(n: Int): Float

Raises this value to the full Int exponent without narrowing the exponent to Float.

Link copied to clipboard
fun round(x: Float): Float

Rounds to an integral value with ties to even, preserving signed zero and non-finite inputs.

Link copied to clipboard

Rounds to the nearest integer, with ties toward positive infinity; rejects NaN and saturates.

Link copied to clipboard

Rounds to the nearest integer, with ties toward positive infinity; rejects NaN and saturates.

Link copied to clipboard
fun sign(x: Double): Double
fun sign(x: Float): Float
Link copied to clipboard
fun sin(x: Double): Double
fun sin(x: Float): Float
Link copied to clipboard
fun sinh(x: Double): Double
fun sinh(x: Float): Float
Link copied to clipboard
infix fun Vector2f.sized(size: Size2f): Rect2f
infix fun Vector2i.sized(size: Size2i): Rect2i
Link copied to clipboard
fun sqrt(x: Double): Double
fun sqrt(x: Float): Float
Link copied to clipboard
fun tan(x: Double): Double
fun tan(x: Float): Float
Link copied to clipboard
fun tanh(x: Double): Double
fun tanh(x: Float): Float
Link copied to clipboard
operator fun Double.times(vector: Vector2d): Vector2d
operator fun Double.times(vector: Vector3d): Vector3d
operator fun Double.times(vector: Vector4d): Vector4d
operator fun Float.times(vector: Vector2f): Vector2f
operator fun Float.times(vector: Vector3f): Vector3f
operator fun Float.times(vector: Vector4f): Vector4f
operator fun Int.times(vector: Vector2i): Vector2i
operator fun Int.times(vector: Vector3i): Vector3i
Link copied to clipboard

Interpret components as a quaternion without changing their values.

Link copied to clipboard

Interpret components as a quaternion without changing their values.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
infix fun Float.xy(y: Float): Vector2f
infix fun Int.xy(y: Int): Vector2i