openrndr / org.openrndr.math

Package org.openrndr.math

code related to math, mostly computer graphics math

Types

CatmulRom1

class CatmulRom1

1D Catmull-Rom segment

CatmullRom2

class CatmullRom2

CatmullRom3

class CatmullRom3

CatmullRomChain1

class CatmullRomChain1

1D Catmull-Rom chain

CatmullRomChain2

class CatmullRomChain2

CatmullRomChain3

class CatmullRomChain3

IntVector2

data class IntVector2 : Serializable

IntVector3

data class IntVector3 : Serializable

IntVector4

data class IntVector4 : Serializable

Matrix44

data class Matrix44 : Serializable

Matrix55

data class Matrix55

Quaternion

data class Quaternion : Serializable

Spherical

data class Spherical

Vector2

data class Vector2 : Serializable

Vector3

data class Vector3 : Serializable

Vector4

data class Vector4 : Serializable

Extensions for External Classes

kotlin.Double

kotlin.Int

Functions

bezier

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 bezier(x0: Double, c0: Double, c1: Double, x1: Double, t: Double): Double
fun bezier(x0: Vector2, c0: Vector2, c1: Vector2, x1: Vector2, t: Double): Vector2fun bezier(x0: Vector3, c0: Vector3, c1: Vector3, x1: Vector3, t: Double): Vector3

Samples a single point on a 3d Bezier curve

clamp

fun clamp(value: Double, min: Double, max: Double): Double

derivative

fun derivative(x0: Double, c0: Double, x1: Double, t: Double): Double
fun derivative(x0: Vector2, c0: Vector2, x1: Vector2, t: Double): Vector2
fun derivative(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: Double): Vector2

dot

fun dot(q1: Quaternion, q2: Quaternion): Double

linearstep

fun linearstep(edge0: Double, edge1: Double, x: Double): Double

map

fun map(beforeLeft: Double, beforeRight: Double, afterLeft: Double, afterRight: Double, value: Double): Double

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

max

fun max(a: Vector2, b: Vector2): Vector2
fun max(a: Vector3, b: Vector3): Vector3
fun max(a: Vector4, b: Vector4): Vector4

min

fun min(a: Vector2, b: Vector2): Vector2
fun min(a: Vector3, b: Vector3): Vector3
fun min(a: Vector4, b: Vector4): Vector4

mix

fun mix(left: Double, right: Double, x: Double): Double

mod

fun mod(a: Double, b: Double): Double
fun mod(a: Int, b: Int): Int
fun mod(a: Float, b: Float): Float
fun mod(a: Long, b: Long): Long

normal

fun normal(x0: Vector2, c0: Vector2, x1: Vector2, t: Double): Vector2

roots

fun roots(p: List<Double>): List<Double>

saturate

fun saturate(x: Double): Double

slerp

fun slerp(q1: Quaternion, q2: Quaternion, x: Double): Quaternion

smootherstep

fun smootherstep(edge0: Double, edge1: Double, x: Double): Double

Smootherstep

smoothstep

fun smoothstep(edge0: Double, edge1: Double, x: Double): Double

Smoothstep

smoothstepIn

fun smoothstepIn(edge0: Double, edge1: Double, x: Double): Double

Smoothstep