• An expression that returns the maximum of the given expression.

      var _ = ExpressionFactory;
    //Evaluates to 2.
    var number = _.max(_.number(1), _.number(2));
    //Evaluates to (2, 2, 3).
    var point1 = _.max(_.point({x: 1, y: 2, z: 3}), _.number(2));
    //Evaluates to (3, 2, 3).
    var point2 = _.max(_.point({x: 1, y: 2, z: 3}), _.point({x: 3, y: 2, z: 1});

    Type Parameters

    • T extends string | number | Vector3

    Parameters

    • first: Expression<T>

      The first expression to evaluate. Should result in a number, point or color.

    • second: Expression<number | T>

      The second expression to evaluate. Should result in the same type as first or a number.

    Returns Expression<T>

    An expression that returns the maximum of the result of the first expression and the result of the second expression. Results in a number, point or color depending on the type of the operands. When a number is used with an other type, the operation is applied to the individual element values and the result is of the other type.