Update mathjs type definitions to 4.4.2 release (from 3.2.1)

This commit is contained in:
DESKTOP-1F3J099\Brad
2018-06-10 15:39:09 -04:00
parent 42e514d82c
commit ecf8cf915c
2 changed files with 4496 additions and 2186 deletions
+4482 -2173
View File
File diff suppressed because it is too large Load Diff
+14 -13
View File
@@ -33,7 +33,7 @@ Bignumbers examples
{
// configure the default type of numbers as BigNumbers
math.config({
number: 'bignumber',
number: 'BigNumber',
precision: 20,
});
@@ -108,9 +108,8 @@ Complex numbers examples
// create a complex number from polar coordinates
{
const p: math.PolarCoordinates = { r: math.sqrt(2), phi: math.pi / 4 };
const c: math.Complex = math
.complex(p);
const p: math.PolarCoordinates = { r: math.sqrt(2), phi: math.pi / 4 };
const c: math.Complex = math.complex(p);
}
// get polar coordinates of a complex number
@@ -175,6 +174,11 @@ Expressions examples
// get and set variables and functions
{
parser.eval('x = 7 / 2'); // 3.5
parser.eval('x + 3'); // 6.5
parser.eval('f(x, y) = x^y'); // f(x, y)
parser.eval('f(2, 3)'); // 8
const x = parser.get('x');
const f = parser.get('f');
const g = f(3, 3);
@@ -193,7 +197,7 @@ Fractions examples
{
// configure the default type of numbers as Fractions
math.config({
number: 'fraction',
number: 'Fraction',
});
const x = math.fraction(0.125);
@@ -205,9 +209,6 @@ Fractions examples
// output formatting
const a = math.fraction('2/3');
console.log(math.format(a));
console.log(math.format(a, {fraction: 'ratio'}));
console.log(math.format(a, {fraction: 'decimal'}));
}
/*
@@ -237,7 +238,7 @@ Matrices examples
b.subset(math.index(1, [0, 1]), [[7, 8]]);
const c = math.multiply(a, b);
const d: math.Matrix = c.subset(math.index(1, 0));
const d: math.Matrix = (<math.Matrix>c).subset(math.index(1, 0));
}
// get a sub matrix
@@ -282,7 +283,7 @@ Sparse matrices examples
// do operations with a sparse matrix
const b = math.multiply(a, a);
const c = math.multiply(b, math.complex(2, 2));
const d = math.transpose(c);
const d = math.transpose((<math.Matrix>c));
const e = math.multiply(d, a);
}
@@ -296,11 +297,11 @@ Units examples
const b = math.unit('0.1m'); // 100 mm
// creating units
math.createUnit('foo');
math.createUnit('foo', '12 meters');
math.createUnit('furlong', '220 yards');
math.createUnit('furlong', '220 yards', {override: true});
math.createUnit('fahrenheit', {definition: '0.555556 kelvin', offset: 459.67});
math.createUnit('fahrenheit', {definition: '0.555556 kelvin', offset: 459.67}, {override: true});
math.createUnit('testunit', {definition: '0.555556 kelvin', offset: 459.67});
math.createUnit('testunit', {definition: '0.555556 kelvin', offset: 459.67}, {override: true});
math.createUnit('knot', {definition: '0.514444 m/s', aliases: ['knots', 'kt', 'kts']});
math.createUnit('knot', {definition: '0.514444 m/s', aliases: ['knots', 'kt', 'kts']}, {override: true});
math.createUnit('knot', {