Demonstrates use of the GeoCAS
library. GeoCAS
provides a multivector type that is parameterized by the field type and supports arbitrary metrics.
By having a parameterized field, the Multivector<T>
type can be used for different kinds of numeric and symbolic computation. The most simple parameterization is to use number
for the T
parameter. This requires using an appropriate adapter for the number
field. GeoCAS
conveniently provides the NumberFieldAdapter
class for this purpose.
Here is an example of how to initialize an algebra for Euclidean 3D space:
const G3 = GeoCAS.algebra([1, 1, 1], new GeoCAS.NumberFieldAdapter())
export const zero = G3.zero;
export const one = G3.one;
export const e1 = G3.unit(0);
export const e2 = G3.unit(1);
export const e3 = G3.unit(2);
If you would like to customize the labels for the basis vectors to be different from the standard 'e1', 'e2', ..., then provide the labels as the last parameter in the algebra
generation function:
const G3 = GeoCAS.algebra([1, 1, 1], new GeoCAS.NumberFieldAdapter(), ['i','j','k'])
GeoCAS
provides several other field adapters (FieldAdapter<T>
type)