Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Functionals

Functions that know their type and units, and can display themselves meaningfully.

Each PFFunction object has a corresponding function object and vice versa.

Index

Other Type aliases

BaseValue

BaseValue: number | BaseValueNonScalar

BaseValueInFrame

BaseValueInFrame: Point | Orientation

BaseValueNonScalar

BaseValueNonScalar: Point | Vector | Orientation | Rotation | NonScalarValue

BaseValueRelative

BaseValueRelative<U>: ScalarValue<U> | Vector<U> | Rotation<U>

Type parameters

BaseValueRelativeNonScalar

BaseValueRelativeNonScalar<U>: Vector<U> | Rotation<U>

Type parameters

Constructor3N

Constructor3N<R>: Constructor<R, [Unit, number, number, number]>

Type parameters

  • R

Constructor4N

Constructor4N<R>: Constructor<R, [Unit, number, number, number, number]>

Type parameters

  • R

DataTypeOf

DataTypeOf<D>: D extends number ? SCALAR : D extends DataType<infer T> ? T : never

Type parameters

  • D

IPCompileResult

IPCompileResult<R, N>:

The result of compilation is a function of N arguments, annotated with originating PFunction and convenience methods.

Type parameters

IPCompiled

IPCompiled<R, U, N, P>: IPFunctionPtr<P> & IPDisplay

Type parameters

IPFunction

IPFunction<R, U, N, D, I>: N extends 1 | 0 ? R extends number ? IPFunctionCalculus<number, U, N, D, I> : R extends Rotation ? IPFunctionCalculus<Rotation, U, N, D, I> : R extends Vector ? IPFunctionCalculus<Vector, U, N, D, I> : R extends Point ? IPFunctionBase<Point, U, N> : R extends Orientation ? IPFunctionBase<Orientation, U, N> : never : IPFunctionBase<R, U, N>

Type parameters

InFrameOf

InFrameOf<T>: T extends Vector ? Point : T extends Rotation ? Orientation : T

Type parameters

  • T

Positional

Positional: Point | Vector

RelativeOf

RelativeOf<T>: T extends Point ? Vector : T extends Orientation ? Rotation : T

Type parameters

  • T

Rotational

Rotational: Orientation | Rotation

ScalarValue

ScalarValue<U>: number

Our primitive datatypes

Type parameters

TexFormatter

TexFormatter: (tex: string) => Element

Hook to provide a compatible LaTeX parser, such as an existing KaTeX implementation, such as provided by ObservableHQ.

Type declaration

    • (tex: string): Element
    • Parameters

      • tex: string

      Returns Element

Variable

Variable: string

Value type Type aliases

Time

Time: Value<number, time>

Velocity

Variables

Const PFunctionDefaults

PFunctionDefaults: [Omit<PFunctionOpts<Unit, 0>, "unit">, Omit<PFunctionOpts<Unit>, "unit">, Omit<PFunctionOpts<Unit, 2>, "unit">, Omit<PFunctionOpts<Unit, 3>, "unit">, Omit<PFunctionOpts<Unit, 4>, "unit">, Omit<PFunctionOpts<Unit, 5>, "unit">, Omit<PFunctionOpts<Unit, 6>, "unit">] = [{vars: [], nargs: 0},{vars: ['t'], nargs: 1},{vars: ['t0', 't'], nargs: 2},{vars: ['t1', 't0', 't'], nargs: 3},{vars: ['t2', 't1', 't0', 't'], nargs: 4},{vars: ['t3', 't2', 't1', 't0', 't'], nargs: 5},{vars: ['t4', 't3', 't2', 't1', 't0', 't'], nargs: 6}]

Let TIMESTEP

TIMESTEP: number = 0.001

Default integration timestep. This can be adjusted per-function.

Functions

add

Const bounds

  • bounds<R>(f: IPCompiled<R>, t: number): [R, R, number]

Const checkUnits

constant

Const datatype

  • datatype(d: any): TYPE

equal

  • equal<T>(a: T, b: T): boolean

gadd

gmul

gsub

Const integrate

  • integrate(f: IPCompiled<number>): (Anonymous function)

Const isBaseValue

  • isBaseValue(v: any): v is BaseValue

Const isIntrinsicValue

  • isIntrinsicValue(v: any): v is BaseValueInFrame

Const isNonScalarValue

  • isNonScalarValue(v: any): v is NonScalarValue

Const isOrientation

  • isOrientation(v: any): v is Orientation

isPCompiled

  • isPCompiled<U, N>(a: any, u: U, n: N): a is IPCompiled<BaseValue, U, N>
  • isPCompiled(a: any): a is IPCompiled<BaseValue, Unit, ArgCount>
  • Type parameters

    • U: Unit

    • N: ArgCount

    Parameters

    • a: any
    • u: U
    • n: N

    Returns a is IPCompiled<BaseValue, U, N>

  • Parameters

    • a: any

    Returns a is IPCompiled<BaseValue, Unit, ArgCount>

isPFunction

  • isPFunction<U, N>(a: any, u: U, n: N): a is IPFunction<BaseValue, U, N>
  • isPFunction(a: any): a is IPFunction

Const isPoint

  • isPoint(v: any): v is Point

Const isPositional

  • isPositional(v: any): v is Positional

isRelative

  • isRelative(v: IPFunction): v is IPFunction<BaseValueRelative>
  • isRelative(v: IPCompiled): v is IPCompiled<BaseValueRelative>
  • isRelative(v: number): v is number
  • isRelative(v: Positional): v is Vector
  • isRelative(v: Rotational): v is Orientation
  • isRelative(v: BaseValue): v is BaseValueRelative

Const isRotation

  • isRotation(v: any): v is Rotation

Const isRotational

  • isRotational(v: any): v is Rotational

isScalar

Const isScalarValue

  • isScalarValue(v: any): v is ScalarValue<Unit>

Const isVector

  • isVector(v: any): v is Vector

Const makeDerivative

  • makeDerivative(f: IPCompiled<number>): (Anonymous function)
  • Calculate the derivative of a function numerically, by examining nearby values on either side of the point. Points that are technically no-differentiable (such as where piecewise-define segments meet) are computed as an average.

    Parameters

    Returns (Anonymous function)

Const makeDerivativeQ

Const makeDerivativeV

Const makePoly

  • makePoly(...coeffs: number[]): (Anonymous function)
  • Parameters

    • Rest ...coeffs: number[]

    Returns (Anonymous function)

mul

near

  • near<T>(a: T, b: T, epsilon?: number): boolean
  • Type parameters

    Parameters

    • a: T
    • b: T
    • Default value epsilon: number = glMatrix.EPSILON

    Returns boolean

orientation

  • orientation<F>(frame: F): (x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number) => Orientation
  • orientation<F>(frame: F, x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number): Orientation
  • Type parameters

    Parameters

    • frame: F

    Returns (x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number) => Orientation

      • (x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number): Orientation
      • Parameters

        • Optional x: undefined | number
        • Optional y: undefined | number
        • Optional z: undefined | number
        • Optional w: undefined | number

        Returns Orientation

  • Type parameters

    Parameters

    • frame: F
    • Optional x: undefined | number
    • Optional y: undefined | number
    • Optional z: undefined | number
    • Optional w: undefined | number

    Returns Orientation

point

  • point<F>(frame: F): (x?: undefined | number, y?: undefined | number, z?: undefined | number) => Point
  • point<F>(frame: F, x?: undefined | number, y?: undefined | number, z?: undefined | number): Point
  • Type parameters

    Parameters

    • frame: F

    Returns (x?: undefined | number, y?: undefined | number, z?: undefined | number) => Point

      • (x?: undefined | number, y?: undefined | number, z?: undefined | number): Point
      • Parameters

        • Optional x: undefined | number
        • Optional y: undefined | number
        • Optional z: undefined | number

        Returns Point

  • Type parameters

    Parameters

    • frame: F
    • Optional x: undefined | number
    • Optional y: undefined | number
    • Optional z: undefined | number

    Returns Point

rotation

  • rotation<U>(unit: U): (x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number) => Rotation<U>
  • rotation<U>(unit: U, x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number): Rotation<U>
  • Type parameters

    Parameters

    • unit: U

    Returns (x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number) => Rotation<U>

      • (x?: undefined | number, y?: undefined | number, z?: undefined | number, w?: undefined | number): Rotation<U>
      • Parameters

        • Optional x: undefined | number
        • Optional y: undefined | number
        • Optional z: undefined | number
        • Optional w: undefined | number

        Returns Rotation<U>

  • Type parameters

    Parameters

    • unit: U
    • Optional x: undefined | number
    • Optional y: undefined | number
    • Optional z: undefined | number
    • Optional w: undefined | number

    Returns Rotation<U>

Const setFormatter

  • setFormatter(inline: TexFormatter, block?: TexFormatter): { block: (tex: string) => Element; inline: (tex: string) => Element }
  • Set the converter to convert LaTeX to HTML. This csn be ObservableHQ's tex... string interpolator—the argument will be set up properly.

    Parameters

    Returns { block: (tex: string) => Element; inline: (tex: string) => Element }

    • block: (tex: string) => Element
        • (tex: string): Element
        • Parameters

          • tex: string

          Returns Element

    • inline: (tex: string) => Element
        • (tex: string): Element
        • Parameters

          • tex: string

          Returns Element

sub

Const valueType

  • valueType(v: any): TYPE

vector

  • vector<U>(unit: U): (x?: undefined | number, y?: undefined | number, z?: undefined | number) => Vector<U>
  • vector<U>(unit: U, x?: undefined | number, y?: undefined | number, z?: undefined | number): Vector<U>
  • Type parameters

    Parameters

    • unit: U

    Returns (x?: undefined | number, y?: undefined | number, z?: undefined | number) => Vector<U>

      • (x?: undefined | number, y?: undefined | number, z?: undefined | number): Vector<U>
      • Parameters

        • Optional x: undefined | number
        • Optional y: undefined | number
        • Optional z: undefined | number

        Returns Vector<U>

  • Type parameters

    Parameters

    • unit: U
    • Optional x: undefined | number
    • Optional y: undefined | number
    • Optional z: undefined | number

    Returns Vector<U>

Generated using TypeDoc