Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ria/util/expression/ExpressionFactory

The ExpressionFactory allows you to create expressions that can be used in styling and filtering by the LuciadRIA painters.

Overview

Type aliases

Color

Color: string

An alias for string representing a Color.

Functions

abs

  • Creates an expression that returns an expression with the absolute value.

    since

    2020.0

    Parameters

    • value: Expression<number>

      The expression to evaluate.

    Returns Expression<number>

    An expression that evaluates to the absolute value of the given expression.

acos

  • An expression that takes the arccosine of another expression. The range of values returned by acos is [0, PI]. |operand| must be less than or equal to 1.

    Type parameters

    Parameters

    • operand: Expression<T>

      The expression of which to take the arccosine. Should result in a number, point or color.

    Returns Expression<T>

    An expression that takes the arccosine of another expression. Results in a number, point or color.

add

  • An expression that adds the result of the given expressions.

      var _ = ExpressionFactory;
      //Evaluates to 3.
      var sum = _.add(_.number(1), _.number(2));
      //Evaluates to (3, 4, 5).
      var point = _.add(_.point({x: 1, y: 2, z: 3}), _.number(2));

    Type parameters

    Parameters

    • left: Expression<T>

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

    • right: Expression<T | number>

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

    Returns Expression<T>

    An expression that adds the results of the given expressions. 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.

and

  • An expression that is the boolean 'and' of the given expressions.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases expression or anywhere an expression that resolves to a boolean is required.

    Parameters

    • Rest ...expressions: Expression<boolean>[]

      The expressions to be 'and'ed together. This can be any number of expressions. Each one should result in a boolean.

    Returns Expression<boolean>

    An expression that is the boolean 'and' of all given expressions. Results in a boolean.

areClose

  • Creates an expression that evaluates whether the two given expression evaluate to close values, given some threshold. To be used with floating point numbers, depending on the context.

    since

    2020.0

    Parameters

    • a: Expression<number>

      The first expression to evaluate.

    • b: Expression<number>

      The second expression to evaluate.

    • threshold: Expression<number>

      The Expression describing the maximum threshold before considering both values too far from each other.

    Returns Expression<boolean>

    An expression that evaluates to true if the two expressions evaluate to close values, given the maximum threshold.

asin

  • An expression that takes the arcsine of another expression. The range of values returned by asin is [-PI/2, PI/2]. |operand| must be less than or equal to 1.

    Type parameters

    Parameters

    • operand: Expression<T>

      The expression of which to take the arcsine. Should result in a number, point or color.

    Returns Expression<T>

    An expression that takes the arcsine of another expression. Results in a number, point or color.

atan

  • An expression that takes the arctangent of another expression. The range of values returned by atan is [-PI/2, PI/2].

    Type parameters

    Parameters

    • operand: Expression<T>

      The expression of which to take the arctangent. Should result in a number, point or color.

    Returns Expression<T>

    An expression that takes the arctangent of another expression. Results in a number, point or color.

attribute

  • (name: string, vectorSize?: number): Expression<number>
  • Returns an attribute expression. Expressions are evaluated for certain objects. Those object may have attributes ascribed to them. This expression allows access to those attributes by name. Which attributes are available depends on the evaluator of the expression. For example, for parameterized point painting, those attributes are defined in the constructor of the ParameterizedPointPainter.

    Parameters

    • name: string

      The name of the attribute to use.

    • Optional vectorSize: number

      The length of the attribute's vector, 1 if it is a simple number.

    Returns Expression<number>

    An expression that represents the attribute.

between

  • Creates an expression that evaluates whether the result of the operand is between a lower and upper bound (inclusive). In other words, this expression checks whether operand is in the range [lowerBound, upperBound].

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases case expression or anywhere an expression that resolves to a boolean is required.

    Parameters

    • operand: Expression<number>

      The operand to evaluate.

    • lowerBound: Expression<number>

      The lowerBound to evaluate.

    • upperBound: Expression<number>

      The upperBound to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to true if the result of operand >= the result of lowerBound and <= the result of upperBound.

boolean

  • Creates an expression representing a boolean.

    Parameters

    • value: boolean

      The value of the boolean.

    Returns Expression<boolean>

    A boolean constant expression.

booleanParameter

  • Creates a new parameter expression. The difference with boolean is that you can change the value of a parameter later on, and the styling will be updated to reflect the new value without having to re-create the expressions in which it is used. Only booleans may be used as value.

      var parameter = ExpressionFactory.booleanParameter(true);
      ...
      parameter.value = false;//Only ever assign booleans.

    Parameters

    • value: boolean

      The initial value of the parameter.

    Returns ParameterExpression<boolean>

    A parameter expression.

cases

  • Returns an expression that can be used to chain multiple when-then statements together. On the returned case expression, you can add cases by calling when with an expression and subsequently call then with another expression. This creates a chain of if-then-else statements. If no cases match, the result of the default expression is used. The expression given as argument to a when-call should result in boolean.

    var defaultExpression = ...;
    var someTestExpression = ...;
    var someResultExpression = ...;
    var someOtherTestExpression = ...;
    var someOtherResultExpression = ...;
    
    var caseExpression = ExpressionFactory.cases(defaultExpression);
    caseExpression.when(someTestExpression).then(someResultExpression)
                  .when(someOtherTestExpression).then(someOtherResultExpression);
    

    Type parameters

    Parameters

    • defaultExpression: Expression<T>

      The expression evaluated if no when-then case is met.

    Returns CaseExpression<T>

    A case expression that can be used to add when-then cases.

clamp

  • Returns an expression that limits an operand to a range. The type of the bounds should be the same.

      var _ = ExpressionFactory;
      //Evaluates to 47.
      var number = _.clamp(_.number(42), _.number(47), _.number(83));
      //Evaluates to a point with values clamped between 47 and 83.
      var clamped = _.clamp(_.point(p1), _.number(47), _.number(83));
      //Evaluates to a point with values of p1 clamped between p2 and p3.
      var elementsIndividuallyClamped = _.clamp(_.point(p1), _.point(p2), _.point(p3));

    Type parameters

    Parameters

    • operand: Expression<T>

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

    • lowerBound: Expression<T | number>

      The lowerBound to evaluate. Should result in the same type as operand or a number.

    • upperBound: Expression<T | number>

      The upperBound to evaluate. Should result in the same type as lowerBound.

    Returns Expression<T>

    An expression that limits a value to the given range. 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.

color

  • Creates an expression representing a Color.

    Parameters

    • value: Color

      The value of the color constant, represented by a CSS color string.

    Returns Expression<Color>

    A color constant expression.

colorParameter

  • Creates a new parameter expression. The difference with color is that you can change the value of a parameter later on, and the styling will be updated to reflect the new value without having to re-create the expressions in which it is used. Only colors may be used as value.

      var parameter = ExpressionFactory.colorParameter("rgba(47, 83, 127, 1)");
      ...
      parameter.value = "rgba(255, 255, 255, 1)";//Only ever assign colors.

    Parameters

    • color: Color

      The initial value of the parameter, represented by a CSS color string.

    Returns ParameterExpression<Color>

    A color parameter expression.

cos

  • An expression that takes the cosine of another expression.

    Type parameters

    Parameters

    • operand: Expression<T>

      The expression of which to take the cosine. Should result in a number, point or color. For points or colors, the function is applied to the individual element values. Values assumed to be in radians.

    Returns Expression<T>

    An expression that takes the cosine of another expression. Results in a number, point or color.

crossProduct

  • An expression that calculates the cross product of two expressions representing vectors.

    Parameters

    • first: Expression<Vector3>

      The first expression to evaluate. Should result in a point (representing a vector).

    • second: Expression<Vector3>

      The second expression to evaluate. Should result in a point (representing a vector).

    Returns Expression<Vector3>

    An expression that calculates the cross product of the given expressions. Results in a point (vector).

defaultColor

  • Returns an expression representing the default color that is applied to a mesh. The result depends on what is available in the data. It can be the color of a texture, a color attribute, a constant color default, etc.

    This type of expression is only supported for mesh styling expressions used by TileSet3DLayer.

    Returns Expression<Color>

distance

  • An expression that calculates the Euclidean distance between two expressions representing points.

    Type parameters

    Parameters

    • first: Expression<T>

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

    • second: Expression<T>

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

    Returns Expression<number>

    An expression that calculates the Euclidean distance between two expressions representing points. Results in a number.

divide

  • An expression that divides the result of the first expression with the result of the second expression.

      var _ = ExpressionFactory;
      //Evaluates to 1.
      var number = _.divide(_.number(2), _.number(2));
      //Evaluates to (1, 2, 3).
      var point = _.divide(_.point({x: 2, y: 4, z: 6}), _.number(2));

    Type parameters

    Parameters

    • left: Expression<T>

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

    • right: Expression<T | number>

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

    Returns Expression<T>

    An expression that divides the result of the first expression with 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.

dotProduct

  • An expression that calculates the dot product of the given expressions. The type of the result of the two given expressions should be the same. You can take the dot product of numbers, points or colors. Points and colors are interpreted as vectors for this operation.

    Type parameters

    Parameters

    • first: Expression<T>

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

    • second: Expression<T>

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

    Returns Expression<T>

    An expression that calculates the dot product of the given expressions. Results in a number.

eq

  • Creates an expression that evaluates whether the two given expression evaluate to the same value.

    Use this kind of expression as the if-expression in an ifThenElse expression, as a when-expression in a cases expression or anywhere an expression that resolves to a boolean is required.

    Type parameters

    Parameters

    • left: Expression<T>

      The first expression to evaluate.

    • right: Expression<T>

      The second expression to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to true if the two expressions evaluate to the same value.

  • Creates an expression that evaluates whether the two given expression evaluate to the same value.

    Use this kind of expression as the if-expression in an ifThenElse expression, as a when-expression in a cases expression or anywhere an expression that resolves to a boolean is required.

    Parameters

    • left: Expression<number>

      The first expression to evaluate.

    • right: Expression<number>

      The second expression to evaluate.

    • Optional threshold: Expression<number>

      The Expression describing the maximum threshold before considering both values not equal.

    Returns Expression<boolean>

    An expression that evaluates to true if the two expressions evaluate to the same value.

fraction

  • Returns an expression that calculates the percentage of the given operand in the range [lowerBound, upperBound]. The expression evaluates to (operand - lowerBound) / (upperBound - lowerBound). For values of operand outside the range [lowerBound, upperBound], the results will lie outside the range [0, 1].

    Type parameters

    Parameters

    • operand: Expression<T>

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

    • lowerBound: Expression<T | number>

      The lowerBound to evaluate. Should result in the same type as operand or a number.

    • upperBound: Expression<T | number>

      The upperBound to evaluate. Should result in the same type as operand or a number.

    Returns Expression<T>

    An expression that calculates the percentage of the given operand in the range [lowerBound, upperBound]. 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.

gt

  • Creates an expression that evaluates whether the result of the first expression is strictly greater than the result of the second expression.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases case expression} or anywhere an expression that resolves to a boolean is required.

    Parameters

    • left: Expression<number>

      The first expression to evaluate.

    • right: Expression<number>

      The second expression to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to true if the result of the first expression is strictly greater than the result of the second expression

gte

  • Creates an expression that evaluates whether the result of the first expression is greater than or equal to the result of the second expression.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases case expression or anywhere an expression that resolves to a boolean is required.

    Parameters

    • left: Expression<number>

      The first expression to evaluate.

    • right: Expression<number>

      The second expression to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to true if the result of the first expression is greater than or equal to the result of the second expression

icon

ifThenElse

  • An expression that implements if-then-else logic.

    Type parameters

    Parameters

    • ifExpression: Expression<boolean>

      The expression that should decide which of the other expressions to take. Should result in a boolean.

    • thenExpression: Expression<T>

      The expression whose result will be returned if the ifExpression results in true.

    • elseExpression: Expression<T>

      The expression whose result will be returned if the ifExpression results in false. Should result in the same type of value as the thenExpression.

    Returns Expression<T>

    An expression that return the result of one of the other expressions, based on the ifExpression.

isInside

  • Returns an expression that resolves to a boolean based on whether the position is inside a given shape expression. For example:

      var _ = ExpressionFactory;
      var shape = _.orientedBox(layer.orientedBox);
      _.isInside(shape);

    results in a contains expression for the bounding oriented box of the layer.

    This type of expression is only supported for styling expressions used by TileSet3DLayer. Only orientedBox expressions are supported as shapes.

    since

    2020.0

    Parameters

    Returns Expression<boolean>

    An expression that represents a contains check on the given shape.

lt

  • Creates an expression that evaluates whether the result of the first expression is strictly less than the result of the second expression.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases case expression. or anywhere an expression that resolves to a boolean is required.

    Parameters

    • left: Expression<number>

      The first expression to evaluate.

    • right: Expression<number>

      The second expression to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to true if the result of the first expression is strictly less than the result of the second expression

lte

  • Creates an expression that evaluates whether the result of the first expression is less than or equal to the result of the second expression.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases case expression or anywhere an expression that resolves to a boolean is required.

    Parameters

    • left: Expression<number>

      The first expression to evaluate.

    • right: Expression<number>

      The second expression to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to true if the result of the first expression is less than or equal to the result of the second expression

map

  • Returns an expression that maps an index onto an expression. The expression first determines an index, then evaluates the expression corresponding to the index.

    For example:

      var _ = ExpressionFactory;
      _.map(_.number(2), [_.color(red), _.color(green), _.color(blue)], _.color(black)) //returns blue
      _.map(_.number(6), [_.color(red), _.color(green), _.color(blue)], _.color(black)) //returns black

    Note that when planning to use a large number of icons in the values array, the elements should be icon expressions. Using more complex expressions in the array is possible but then the number of elements is limited. The exact number depends on computer configuration but you can assume it is close to 20.

    Type parameters

    Parameters

    • indexExpression: Expression<number>

      The expression that calculates the index to use.

    • values: Expression<T>[]

      An array of value expressions.

    • defaultExpression: Expression<T>

      The expression used as default when the computed index is not valid.

    Returns Expression<T>

    An expression that maps an index onto an expression.

max

  • 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

    Parameters

    • first: Expression<T>

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

    • second: Expression<T | number>

      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.

min

  • An expression that returns the minimum of the given expressions.

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

    Type parameters

    Parameters

    • first: Expression<T>

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

    • second: Expression<T | number>

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

    Returns Expression<T>

    An expression that returns the minimum 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.

mix

  • Returns an expression that calculates an interpolated or extrapolated result between the result of first and second based on the result of third. The type of the result of the first two expressions should be the same. You can interpolate between numbers, points or colors. The type of the result of the last expression can be a number or of the same type as the first two. The last argument represents the fraction to use when interpolating or extrapolating.

      var _ = ExpressionFactory;
      //Evaluates to 83.
      var number : _.mix(_.number(47), _.number(83), _.number(1));
      //Evaluates to a point halfway between p1 and p2.
      var middle = _.mix(_.point(p1), _.point(p2), _.number(0.5));
      //Evaluates to a point for which the y-component is close to but not equal to the middle.
      var notTheMiddle = _.mix(_.point(p1), _.point(p2), _.point({x: 0.5, y: 0.4, z: 0.5}));

    Type parameters

    Parameters

    • first: Expression<T>

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

    • second: Expression<T>

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

    • third: Expression<T | number>

      The third expression to evaluate. Should result in the same type as first or a number. Represents the fraction. In range [0,1] for interpolation, <0 or >1 for extrapolation.

    Returns Expression<T>

    An expression that calculates an interpolated or extrapolated result between the result of first and second based on the result of third. 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.

mixmap

  • Returns an expression that creates an interpolated value. This expression is not limited to numbers, but can also be used to interpolate points or colors. For example:

      var _ = ExpressionFactory;
      _.mixmap(_.number(0.75), [_.color(orange), _.color(yellow), _.color(red)])

    results in a color between yellow and red.

    Type parameters

    Parameters

    • aFraction: Expression<number>

      The fraction, in range [0,1].

    • values: Expression<T>[]

      An array of value expressions.

    Returns Expression<T>

    An expression that creates an interpolated value.

multiply

  • An expression that multiplies the result of the given expressions.

      var _ = ExpressionFactory;
      //Evaluates to 2.
      var number = _.multiply(_.number(1), _.number(2));
      //Evaluates to (2, 4, 6).
      var point = _.multiply(_.point({x: 1, y: 2, z: 3}), _.number(2));

    Type parameters

    Parameters

    • left: Expression<T>

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

    • right: Expression<T | number>

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

    Returns Expression<T>

    An expression that multiplies the results of the given expressions. 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.

neq

  • Creates an expression that evaluates whether the two given expression do not evaluate to the same value.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases case expression or anywhere an expression that resolves to a boolean is required.

    Type parameters

    Parameters

    • left: Expression<T>

      The first expression to evaluate.

    • right: Expression<T>

      The second expression to evaluate.

    Returns Expression<boolean>

    An expression that evaluates to false if the two expressions evaluate to the same value.

not

  • An expression that is the boolean 'not' of the given expression.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases expression. or anywhere an expression that resolves to a boolean is required.

    Parameters

    • operand: Expression<boolean>

      The operand. Should result in a boolean.

    Returns Expression<boolean>

    An expression that is the boolean 'not' of the given expression. Results in a boolean.

number

  • Creates an expression representing a number.

    Parameters

    • value: number

      The value of the number constant.

    Returns Expression<number>

    A number constant expression.

numberParameter

  • Creates a new parameter expression. The difference with number is that you can change the value of a parameter later on, and the styling will be updated to reflect the new value without having to re-create the expressions in which it is used. Only numbers may be used as value.

      var parameter = ExpressionFactory.numberParameter(47);
      ...
      parameter.value = 83;//Only ever assign numbers.

    Parameters

    • value: number

      The initial value of the parameter.

    Returns ParameterExpression<number>

    A parameter expression.

or

  • An expression that is the boolean 'or' of the given expressions.

    Use this kind of expression as the if-expression in an ifThenElse, as a when-expression in a cases expression. or anywhere an expression that resolves to a boolean is required.

    Parameters

    • Rest ...expressions: Expression<boolean>[]

      The expressions to be 'or'ed together. This can be any number of expressions. Each one should result in a boolean.

    Returns Expression<boolean>

    An expression that is the boolean 'or' of all given expressions. Results in a boolean.

orientedBox

point

  • Creates an expression representing a point.

    Parameters

    • value: Vector3

      The value of the point constant.

    Returns Expression<Vector3>

    A point constant expression.

pointParameter

  • Creates a new parameter expression. The difference with point is that you can change the value of a parameter later on, and the styling will be updated to reflect the new value without having to re-create the expressions in which it is used. Only points may be used as value.

      var parameter = ExpressionFactory.pointParameter(p1);
      ...
      parameter.value = p2;//Only ever assign points.

    Parameters

    • value: Vector3

      The initial value of the parameter. Can be an object literal with x, y and z properties.

    Returns ParameterExpression<Vector3>

    A parameter expression.

positionAttribute

  • Creates an expression that represents the map (or world) position of the feature.

    For example, this can be used to style dependent on the distance of the mouse to the feature. Note that the mouse parameter in the code example below needs to be updated when the mouse moves (not shown).

      var _ = ExpressionFactory;
      var position = _.positionAttribute();
      var mouseParam = _.pointParameter({x: 0, y: 0, z: 0});//Initial value.  Needs updating.
      var distanceToMouse = _.distance(position, mouseParam);//World (Euclidean) distance.
    
      var radiusOfEffect = _.number(1000000);//Only apply when the mouse is (relatively) close to the feature.
      var mouseMultiplier = _.ifThenElse(_.lt(distanceToMouse, radiusOfEffect),
                                         _.divide(radiusOfEffect, distanceToMouse),
                                         _.number(1));
      var colorExpression = _.multiply(_.color("rgba(127, 127, 127, 1)"), mouseMultiplier);//Brighten as the mouse moves closer.

    Returns Expression<Vector3>

    An expression that represents the position of a feature.

pow

  • An expression that returns the result of the first expression raised to the power of the result of the second expression. The type of the operands should be the same. The (elements of the) first argument must not be less than 0 and if it is 0, the (corresponding elements of the) second argument must be greater than 0.

    Type parameters

    Parameters

    • first: Expression<T>

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

    • second: Expression<T>

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

    Returns Expression<T>

    An expression that returns the result of the first expression to the power of the result of the second expression. Results in a number, point or color depending on the type of the operands.

pushDown

  • Returns an expression that resolves to a vector pointing downwards (towards the center of the Earth) for everything inside the given shape. It resolves to a zero vector for everything outside the given shape. This expression is useful, for example, as a displacement expression on MeshStyle to displace (parts of) meshes. For example:

      var _ = ExpressionFactory;
      var shape = _.orientedBox(layer.orientedBox);
      _.pushDown(shape);

    results in an expression that represents the vector to push down everything inside the bounding oriented box of the layer.

    This type of expression is only supported for styling expressions used by TileSet3DLayer. Only orientedBox expressions are supported as shapes.

    since

    2020.0

    Parameters

    Returns Expression<Vector3>

    An expression that represents a displacement based on the given shape.

sin

  • An expression that takes the sine of another expression.

    Type parameters

    Parameters

    • operand: Expression<T>

      The expression of which to take the sine. Should result in a number, point or color. For points or colors, the function is applied to the individual element values. Values assumed to be in radians.

    Returns Expression<T>

    An expression that takes the sine of another expression. Results in a number, point or color.

subtract

  • An expression that subtracts the result of the second expression from the result of the first expression.

      var _ = ExpressionFactory;
      //Evaluates to 1.
      var number = _.subtract(_.number(3), _.number(2));
      //Evaluates to (1, 2, 3).
      var point = _.subtract(_.point({x: 3, y: 4, z: 5}), _.number(2));

    Type parameters

    Parameters

    • left: Expression<T>

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

    • right: Expression<T | number>

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

    Returns Expression<T>

    An expression that subtracts the result of the second expression from the result of the first 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.

tan

  • An expression that takes the tangent of another expression.

    Type parameters

    Parameters

    • operand: Expression<T>

      The expression of which to take the tangent. Should result in a number, point or color. For points or colors, the function is applied to the individual element values. Values assumed to be in radians.

    Returns Expression<T>

    An expression that takes the tangent of another expression. Results in a number, point or color.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method