Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Expression

Represents vector expressions. That is, all the vector components are either Scalar.Constants or Scalar.Variables or Scalar.Variables or Scalar.Expressions. All the components are interpreted as in the Cartesian system.

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.

    • dimension: number
    • 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.

    • dimension: number
    • 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

dimension

dimension: number

op

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

neg

  • Evaluates and returns the negated value of a vector constant. A negative vector \( - \overrightarrow{A} \) is defined such that

    \[ \overrightarrow{A} + \left( - \overrightarrow{A} \right) = \overrightarrow{0} \].

    Component wise, if \( \overrightarrow{A} = a_i \hat{e_i} \), it can be expressed as

    \[ - \overrightarrow{A} = -a_i \hat{e_i} \].

    Returns Expression

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

Static unit

Generated using TypeDoc