Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Expression

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a vector expression for a binary operator with left and right hand side arguments.

    Parameters

    • op: BinaryOperator

      The root binary operator.

    • lhs: Evaluable

      The left hand side argument for the root operator.

    • rhs: Evaluable

      The right hand side argument for the root operator.

    • X: function

      The accessor function which defines what the ith element should be.

    • Rest ...args: any[]

    Returns Expression

  • Creates a vector expression for a binary operator with left and right hand side arguments.

    Parameters

    • op: UnaryOperator

      The root binary operator.

    • arg: Evaluable

      The argument for the root operator.

    • X: function

      The accessor function which defines what the ith element should be.

    • Rest ...args: any[]

    Returns Expression

Properties

X

X: function

Returns the components of this vector. The index values start from 1 instead of the commonly used starting index 0.

param

The index of the desired component.

returns

The Scalar element at given index.

Type declaration

arg_list

arg_list: Set<_Variable>

classRef

classRef: Expression = Vector.Expression

op

The root binary operator.

operands

operands: Evaluable[] = []

quantity

quantity: "vector" = "vector"

rest

rest: any[]

type

type: "expression" = "expression"

Accessors

arg

lhs

  • The left hand side operand for this.op.

    throws

    If this.op is a UnaryOperator.

    Returns Evaluable

rhs

  • The right hand side operand for this.op.

    throws

    If this.op is a UnaryOperator.

    Returns Evaluable

Methods

add

  • Creates and returns a Vector.Expression for the addition of two Vector objects. The type of that does not matter because adding an unknown vector/vector expression to another vector always results in an expression.

    Parameters

    Returns Expression

    Expression for sum of this and that.

at

cross

  • Creates and returns a Vector.Expression for the cross product of two Vector objects. The type of that does not matter because cross multiplying an unknown vector/vector expression to another vector always results in an expression.

    Parameters

    Returns Expression

    Expression for vector product of this and that.

dot

  • Creates and returns a Vector.Expression for the dot product of two Vector objects. The type of that does not matter because dot multiplying an unknown vector/vector expression with another vector always results in an expression.

    Parameters

    Returns Expression

    Expression for inner product of this and that.

getDefinition

  • getDefinition(methodName: string): "instance" | "static" | "undefined"
  • Checks whether a method exists on the object or as a static member of the class.

    Parameters

    • methodName: string

      Name of the method.

    Returns "instance" | "static" | "undefined"

isFunctionOf

  • isFunctionOf(v: _Variable): boolean

scale

sub

  • Creates and returns a Vector.Expression for the subtraction of two Vector objects. The type of that does not matter because subtracting an unknown vector/vector expression from another vector always results in an expression.

    Parameters

    Returns Expression

    Expression for subtracting that from this.

Static mag

  • Computes the magnitude of a given vector. If A vector is a constant vector then numerically calculates the magnitude otherwise creates a scalar Expression and returns the same.

    Parameters

    Returns void

    The Scalar magnitude of the given Vector.

Static unit

Generated using TypeDoc