scale

open fun scale(n: Double, x1: Double, x2: Double, y1: Double, y2: Double): Double

Scale a number in the range of x1 to x2, to the range of y1 to y2.

Return

a double scaled to a value between y1 and y2, inclusive

Parameters

n

number to scale

x1

lower bound range of n

x2

upper bound range of n

y1

lower bound of scale

y2

upper bound of scale


open fun scale(n: Float, x1: Float, x2: Float, y1: Float, y2: Float): Float

Scale a number in the range of x1 to x2, to the range of y1 to y2.

Return

a float scaled to a value between y1 and y2, inclusive

Parameters

n

number to scale

x1

lower bound range of n

x2

upper bound range of n

y1

lower bound of scale

y2

upper bound of scale