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

BaseValueInFrame

BaseValueInFrame: Point | Orientation

BaseValueNonScalar

BaseValueNonScalar: Point | Vector | Orientation | Rotation

BaseValueRelative

BaseValueRelative: ScalarValue | Vector | Rotation

BaseValueRelativeNonScalar

BaseValueRelativeNonScalar: Vector | Rotation

Constructor3N

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

Type parameters

  • R

Constructor4N

Constructor4N<R>: Constructor<R, [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> & IPCompiledDisplay

Type parameters

IPFunction

IPFunction<R, U, N, D, I>: N extends 1 ? 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: number

Our primitive datatypes

TVPairs

TVPairs<R, C, D, I>: [number, IPCalculus<R, C, D, I>, Object]

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

Value type Type aliases

Time

Time: Value<number, time>

Velocity

Velocity: Value<Vector, 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]

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

isIntrinsic

  • isIntrinsic(v: IPFunction): v is IPFunction<BaseValueInFrame>
  • isIntrinsic(v: IPCompiled): v is IPCompiled<BaseValueInFrame>
  • isIntrinsic(v: number): false
  • isIntrinsic(v: Positional): v is Point
  • isIntrinsic(v: Rotational): v is Orientation
  • isIntrinsic(v: BaseValue): v is BaseValueInFrame

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

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

Const orientation

Const point

Const rotation

  • rotation(i?: number, j?: number, k?: number, w?: number): Rotation
  • Parameters

    • Default value i: number = 0
    • Default value j: number = 0
    • Default value k: number = 0
    • Default value w: number = 1

    Returns Rotation

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

Const vector

  • vector(x?: number, y?: number, z?: number): Vector
  • Parameters

    • Default value x: number = 0
    • Default value y: number = 0
    • Default value z: number = 0

    Returns Vector

Generated using TypeDoc