Skip to main content

bpf

bpf(
@pts ## list (required)
@xfunc <normalization_function>
@yfunc null
@sfunc null
) -> llll

Formats an numeric list into a breakpoint function, in the form of [ <x> <y> <slope> ] tuples. By default, <x> is normalized to the 0-1 range. To prevent this, set @xfunc to null.


Arguments

  • @pts [list]: Numeric list (required)
  • @xfunc [function/null]: Optional lambda function for x axis (default: <normalization_function>).
  • @yfunc [function/null]: Optional lambda function for y axis (default: null).
  • @sfunc [function/null]: Optional lambda function for bpf slope (default: null).

Output

Breakpoint function [llll]


Usage

bpf(1 2 3); ## [0 1 0] [0.5 2 0] [1 3 0]
bpf([0 1 0] [1 0 -0.25] @yfunc ($y -> $y + 0.5)) ## [0 1.5 0] [1 2.5 0]