map

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.

Return

a value in the after range

Parameters

beforeLeft

the lowest value of the before range

beforeRight

the highest value of the before range

afterLeft

the lowest value of the after range

afterRight

the highest value of the after range

value

the value to be mapped

clamp

constrain the result to the after range

fun map(before: ClosedFloatingPointRange<Double>, after: ClosedFloatingPointRange<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.

Return

a value in the after range

Parameters

before

the before range

after

the after range

value

the value to be mapped

clamp

constrain the result to the after range

@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

Return

a value in the after range

Parameters

beforeLeft

the lowest value of the before range

beforeRight

the highest value of the before range

afterLeft

the lowest value of the after range

afterRight

the highest value of the after range

clamp

constrain the result to the after range

fun Double.map(before: ClosedFloatingPointRange<Double>, after: ClosedFloatingPointRange<Double>, clamp: Boolean = false): Double

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

Return

a value in the after range

Parameters

before

the before range

after

the after range

clamp

constrain the result to the after range

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