Interface Adapter<T, K>

An interface that allows a Blade to interact with an arbitrary field, and allows blades to be summed into tree representing a multivector.

F is the type of the field over which the multivector operates. K is the type of the atom that represents a tree.

interface Adapter<T, K> {
    one: T;
    zero: T;
    ε: T;
    abs(arg): T;
    add(lhs, rhs): T;
    asString(arg): string;
    bladeToTree(blade): K;
    cos(arg): T;
    dim(arg): number;
    div(lhs, rhs): T;
    eq(lhs, rhs): boolean;
    extractGrade(arg, grade): K;
    ge(lhs, rhs): boolean;
    gt(lhs, rhs): boolean;
    isDimension(arg): boolean;
    isField(arg): arg is T;
    isOne(arg): boolean;
    isZero(arg): boolean;
    le(lhs, rhs): boolean;
    lt(lhs, rhs): boolean;
    max(lhs, rhs): T;
    min(lhs, rhs): T;
    mul(lhs, rhs): T;
    ne(lhs, rhs): boolean;
    neg(arg): T;
    scalarCoordinate(arg): T;
    sin(arg): T;
    sqrt(arg): T;
    sub(lhs, rhs): T;
    sum(terms): K;
    treeAdd(lhs, rhs): K;
    treeLco(lhs, rhs): K;
    treeMul(lhs, rhs): K;
    treeScp(lhs, rhs): K;
    treeSqrt(arg): K;
    treeZero(): K;
    weightToTree(arg): K;
}

Type Parameters

  • T
  • K

Properties

one: T
zero: T
ε: T

Methods

  • Extracts the dimension of the metric from the argument. Supports the case where the metric is Euclidean and only the dimensionality need be known.

    Parameters

    • arg: T

    Returns number

  • Determines whether the argument can represent the dimension of a metric. It must be possible to convert the argument to a number which is also a positive integer. Supports the case where the metric is Euclidean and only the dimensionality need be known.

    Parameters

    • arg: T

    Returns boolean

  • The implementation should calculate sum over terms of (term.blade * term.weight). There is an assumption that the weight is a scalar quantity, i.e. it commutes with the blade.

    Parameters

    Returns K