ixfx
    Preparing search index...

    Type Alias BipolarWrapper

    Wrapper around a bipolar value. Immutable.

    let b = Bipolar.immutable();
    let b = Bipolar.immutable(0.5);
    b = b.add(0.1);
    type BipolarWrapper = {
        "[toPrimitive]": (hint: string) => number | string | boolean;
        add: (amount: number) => BipolarWrapper;
        asScalar: () => number;
        interpolate: (amount: number, target: number) => BipolarWrapper;
        inverse: () => BipolarWrapper;
        multiply: (amount: number) => BipolarWrapper;
        towardZero: (amount: number) => BipolarWrapper;
        value: number;
    }
    Index

    Properties

    "[toPrimitive]": (hint: string) => number | string | boolean
    add: (amount: number) => BipolarWrapper

    Add some amount to the bipolar value, clipping it to the -1...1 range

    let b = immutable(0);
    b = b.add(0.5); // 0.5

    Type Declaration

    asScalar: () => number

    Convert to 0..1 scale

    let b = immutable(-1);
    b.asScalar(); // 0

    Type Declaration

      • (): number
      • Returns number

    interpolate: (amount: number, target: number) => BipolarWrapper

    Interpolate toward target by amount

    Type Declaration

    inverse: () => BipolarWrapper

    Inverse value

    let b = immutable(1);
    b = b.inverse(); // -1

    Type Declaration

    multiply: (amount: number) => BipolarWrapper

    Multiple the value by amount, clipping result to the -1...1 range.

    let b = immutable(1);
    b = b.multiply(0.1); // 0.9

    @param amount @returns

    towardZero: (amount: number) => BipolarWrapper

    Nudge toward zero by amount

    let b = immutable(1);
    b = b.towardZero(0.1); // 0.9

    Type Declaration

    value: number

    Current value