v3 added a couple of range mapping functions
Added:
mapping_linear(x, max1, min1, max2, min2)
convert value in range A to value in range B
Parameters:
x (float): the input data series within range 1, to be mapped to range 2
max1 (float): the maximum value in range 1 (origin)
min1 (float): the minimum value in range 1 (origin)
max2 (float): the maximum value in range 2 (target)
min2 (float): the minimum value in range 2 (target)
mapping_sigmoid(x, speed_scale, upper_bound, lower_bound, center)
fully customizable version of mapping_sigmoid (upper, lower, center, range_ratio, speed). This version adjusts the lower range's speed for imbalanced upper/lower range sizes, so the slope before and after crossing the center stays the same
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
upper_bound (float): the maximum value for input values towards positive infinity
lower_bound (float): the minimum value for input values towards negative infinity
center (float): the center value
mapping_sigmoid_fast(x, speed_scale, range_size, center)
simplified version of mapping_sigmoid, no adjusted lower range speed, equal range size (center to edge, i.e. actually half range)
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
range_size (float): instead of defining separate upper_bound/lower_bound, we add this value above and below the center to get balanced range sizes
center (float): the center value
mapping_sigmoid_1_0_1(x, speed_scale)
simplified version of mapping_sigmoid, with a fixed output range -1 | 0 | 1
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
mapping_sigmoid_0_05_1(x, speed_scale)
simplified version of mapping_sigmoid, with a fixed output range 0 | 0,5 | 1
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
mapping_sigmoid_upper_0_1(x, scale)
simplified version of mapping_sigmoid, with a fixed positive output range 0 | 1 (negative x inputs default to 0)
Parameters:
x (float)
scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)