Function
src/index.ts:688nerdamer.connect
nerdamer.connect(names: readonly string[], source: NumericalFunctionSource): typeof nerdamerImports numerical implementations from another library while preserving Nerdamer's symbolic
representation of the selected functions.
Imported functions are used by numerical evaluation and by buildFunction(). New function
names remain symbolic during ordinary parsing; existing Nerdamer functions retain their
symbolic simplification rules.
Parameters
| Name | Type | Description |
|---|---|---|
names | readonly string[] | Function names to import from source. |
source | NumericalFunctionSource | Object containing numerical functions, such as a mathjs instance. |
Returns
typeof nerdamer — The root nerdamer function for chaining.
Examples
nerdamer.connect(['cos'], math);
nerdamer('cos(x)').text(); // 'cos(x)'
nerdamer('cos(x)').evaluate({ x: 0 }).text(); // '1'