From 6f2c459e69d1778b485640007fb2cf2e893e057b Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Tue, 13 Jun 2023 12:21:04 +0200 Subject: [PATCH] chore: publish mathjs v11.8.1 --- docs/datatypes/units.md | 6 ++-- docs/expressions/parsing.md | 2 +- docs/reference/functions.md | 20 ++++++------- docs/reference/functions/derivative.md | 4 +-- docs/reference/functions/distance.md | 14 ++++----- docs/reference/functions/leafCount.md | 2 +- docs/reference/functions/map.md | 11 ++----- docs/reference/functions/parser.md | 2 +- docs/reference/functions/polynomialRoot.md | 2 +- docs/reference/functions/rationalize.md | 8 ++--- docs/reference/functions/resolve.md | 2 +- docs/reference/functions/simplify.md | 14 ++++----- docs/reference/functions/simplifyConstant.md | 4 +-- docs/reference/functions/simplifyCore.md | 4 +-- docs/reference/functions/sqrtm.md | 2 +- docs/reference/functions/symbolicEqual.md | 14 ++++----- download.md | 8 ++--- examples/browser/angle_configuration.html | 2 +- examples/browser/angle_configuration.html.md | 2 +- examples/browser/basic_usage.html | 2 +- examples/browser/basic_usage.html.md | 2 +- examples/browser/currency_conversion.html | 2 +- examples/browser/currency_conversion.html.md | 2 +- examples/browser/custom_separators.html | 2 +- examples/browser/custom_separators.html.md | 2 +- examples/browser/plot.html | 2 +- examples/browser/plot.html.md | 2 +- .../browser/pretty_printing_with_mathjax.html | 2 +- .../pretty_printing_with_mathjax.html.md | 2 +- examples/browser/printing_html.html | 2 +- examples/browser/printing_html.html.md | 2 +- examples/browser/requirejs_loading.html | 2 +- examples/browser/requirejs_loading.html.md | 2 +- .../rocket_trajectory_optimization.html | 2 +- .../rocket_trajectory_optimization.html.md | 2 +- examples/browser/webworkers/index.md | 2 +- examples/browser/webworkers/worker.js | 2 +- history.md | 18 ++++++++++- js/lib/math.js | 2 +- js/lib/math.js.LICENSE.txt | 4 +-- js/lib/math.js.map | 2 +- mathjs-src | 2 +- package-lock.json | 30 +++++++++---------- package.json | 2 +- 44 files changed, 115 insertions(+), 104 deletions(-) diff --git a/docs/datatypes/units.md b/docs/datatypes/units.md index 483294b32..32d38a45e 100644 --- a/docs/datatypes/units.md +++ b/docs/datatypes/units.md @@ -33,16 +33,16 @@ const c = math.unit('2 inch') // Unit 2 inch const d = math.unit('90 km/h') // Unit 90 km/h const e = math.unit('101325 kg/(m s^2)') // Unit 101325 kg / (m s^2) -const d = c.to('cm') // Unit 5.08 cm +const f = c.to('cm') // Unit 5.08 cm b.toNumber('gram') // Number 100 math.number(b, 'gram') // Number 100 c.equals(a) // false -c.equals(d) // true +c.equals(f) // true c.equalBase(a) // true c.equalBase(b) // false -d.toString() // String "5.08 cm" +f.toString() // String "5.08 cm" const kph = math.unit('km/h') // valueless Unit km/h const mps = math.unit('m/s') // valueless Unit m/s diff --git a/docs/expressions/parsing.md b/docs/expressions/parsing.md index 2db7fe958..e829ca221 100644 --- a/docs/expressions/parsing.md +++ b/docs/expressions/parsing.md @@ -196,7 +196,7 @@ parser.evaluate('f(x, y) = x^y') // f(x, y) parser.evaluate('f(2, 3)') // 8 // get and set variables and functions -const x = parser.get('x') // x = 7 +const x = parser.get('x') // x = 3.5 const f = parser.get('f') // function const g = f(3, 3) // g = 27 parser.set('h', 500) diff --git a/docs/reference/functions.md b/docs/reference/functions.md index a4775ad51..bb6fc966d 100644 --- a/docs/reference/functions.md +++ b/docs/reference/functions.md @@ -17,24 +17,24 @@ Function | Description Function | Description ---- | ----------- -[derivative(expr, variable)](functions/derivative.html) | Takes the derivative of an expression expressed in parser Nodes. -[leafCount(expr)](functions/leafCount.html) | Gives the number of "leaf nodes" in the parse tree of the given expression A leaf node is one that has no subexpressions, essentially either a symbol or a constant. +[math.derivative(expr, variable)](functions/derivative.html) | Takes the derivative of an expression expressed in parser Nodes. +[math.leafCount(expr)](functions/leafCount.html) | Gives the number of "leaf nodes" in the parse tree of the given expression A leaf node is one that has no subexpressions, essentially either a symbol or a constant. [math.lsolve(L, b)](functions/lsolve.html) | Finds one solution of a linear equation system by forwards substitution. [math.lsolveAll(L, b)](functions/lsolveAll.html) | Finds all solutions of a linear equation system by forwards substitution. [math.lup(A)](functions/lup.html) | Calculate the Matrix LU decomposition with partial pivoting. [math.lusolve(A, b)](functions/lusolve.html) | Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector. [math.lyap(A, Q)](functions/lyap.html) | Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where Q is an input matrix. -[polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)](functions/polynomialRoot.html) | Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients. +[math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)](functions/polynomialRoot.html) | Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients. [math.qr(A)](functions/qr.html) | Calculate the Matrix QR decomposition. -[rationalize(expr)](functions/rationalize.html) | Transform a rationalizable expression in a rational fraction. -[resolve(expr, scope)](functions/resolve.html) | resolve(expr, scope) replaces variable nodes with their scoped values. +[math.rationalize(expr)](functions/rationalize.html) | Transform a rationalizable expression in a rational fraction. +[math.resolve(expr, scope)](functions/resolve.html) | resolve(expr, scope) replaces variable nodes with their scoped values. [math.schur(A)](functions/schur.html) | Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal and T is upper quasi-triangular. -[simplify(expr)](functions/simplify.html) | Simplify an expression tree. -[simplifyConstant(expr)](functions/simplifyConstant.html) | simplifyConstant() takes a mathjs expression (either a Node representing a parse tree or a string which it parses to produce a node), and replaces any subexpression of it consisting entirely of constants with the computed value of that subexpression. -[simplifyCore(expr)](functions/simplifyCore.html) | simplifyCore() performs single pass simplification suitable for applications requiring ultimate performance. +[math.simplify(expr)](functions/simplify.html) | Simplify an expression tree. +[math.simplifyConstant(expr)](functions/simplifyConstant.html) | simplifyConstant() takes a mathjs expression (either a Node representing a parse tree or a string which it parses to produce a node), and replaces any subexpression of it consisting entirely of constants with the computed value of that subexpression. +[math.simplifyCore(expr)](functions/simplifyCore.html) | simplifyCore() performs single pass simplification suitable for applications requiring ultimate performance. [math.slu(A, order, threshold)](functions/slu.html) | Calculate the Sparse Matrix LU decomposition with full pivoting. [math.sylvester(A, B, C)](functions/sylvester.html) | Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are matrices of appropriate dimensions, being A and B squared. -[symbolicEqual(expr1, expr2)](functions/symbolicEqual.html) | Attempts to determine if two expressions are symbolically equal, i. +[math.symbolicEqual(expr1, expr2)](functions/symbolicEqual.html) | Attempts to determine if two expressions are symbolically equal, i. [math.usolve(U, b)](functions/usolve.html) | Finds one solution of a linear equation system by backward substitution. [math.usolveAll(U, b)](functions/usolveAll.html) | Finds all solutions of a linear equation system by backward substitution. @@ -164,7 +164,7 @@ Function | Description [math.row(value, index)](functions/row.html) | Return a row from a Matrix. [math.size(x)](functions/size.html) | Calculate the size of a matrix or scalar. [math.sort(x)](functions/sort.html) | Sort the items in a matrix. -[X = math.sqrtm(A)](functions/sqrtm.html) | Calculate the principal square root of a square matrix. +[math.sqrtm(A)](functions/sqrtm.html) | Calculate the principal square root of a square matrix. [math.squeeze(x)](functions/squeeze.html) | Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. [math.subset(x, index [, replacement])](functions/subset.html) | Get or set a subset of a matrix or string. [math.trace(x)](functions/trace.html) | Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. diff --git a/docs/reference/functions/derivative.md b/docs/reference/functions/derivative.md index d700d32a4..c671648e6 100644 --- a/docs/reference/functions/derivative.md +++ b/docs/reference/functions/derivative.md @@ -19,8 +19,8 @@ This uses rules of differentiation which can be found here:

Syntax #

```js -derivative(expr, variable) -derivative(expr, variable, options) +math.derivative(expr, variable) +math.derivative(expr, variable, options) ```

Parameters #

diff --git a/docs/reference/functions/distance.md b/docs/reference/functions/distance.md index d6817ffef..d4dc103f8 100644 --- a/docs/reference/functions/distance.md +++ b/docs/reference/functions/distance.md @@ -25,10 +25,10 @@ math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwo math.distance([x1,y1,z1,a1], [x2,y2,z2,a2]) math.distance([[x1,y1], [x2,y2], [x3,y3]]) math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]]) -math.distance([x1,y1], [x2,y2,z2]) -math.distance([x1,y1], [x2,y2], [x3,y3]) +math.distance([pointX,pointY], [a,b,c]) +math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY]) math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY}) -math.distance([x1,y1,z1], [x0, y0, z0, a, b, c]) +math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c]) math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c}) ``` @@ -67,11 +67,11 @@ math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2 math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1] math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608] math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387 -math.distance([10, 10], [2, 3], [-8, 0]) // Returns 8.759953130362847 +math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4 math.distance( - {pointX: 1, pointY: 4}, - {lineOnePtX: 6, lineOnePtY: 3}, - {lineTwoPtX: 2, lineTwoPtY: 8}) // Returns 2.720549372624744 + {pointX: 0, pointY: 0}, + {lineOnePtX: 3, lineOnePtY: 0}, + {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4 math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857 math.distance( {pointX: 2, pointY: 3, pointZ: 1}, diff --git a/docs/reference/functions/leafCount.md b/docs/reference/functions/leafCount.md index df567a28b..fcca19ca8 100644 --- a/docs/reference/functions/leafCount.md +++ b/docs/reference/functions/leafCount.md @@ -20,7 +20,7 @@ does so. In many cases, `simplify()` reduces the leaf count.

Syntax #

```js -leafCount(expr) +math.leafCount(expr) ```

Parameters #

diff --git a/docs/reference/functions/map.md b/docs/reference/functions/map.md index dbf24dbc0..b1fdfb762 100644 --- a/docs/reference/functions/map.md +++ b/docs/reference/functions/map.md @@ -50,14 +50,9 @@ math.map([1, 2, 3], function(value) { return value * value }) // returns [1, 4, 9] -// The calling convention for the callback can cause subtleties: -math.map([1, 2, 3], math.format) -// throws TypeError: map attempted to call 'format(1,[0])' but argument 2 of type Array does not match expected type number or function or Object or string or boolean -// [This happens because `format` _can_ take a second argument, -// but its semantics don't match that of the 2nd argument `map` provides] - -// To avoid this error, use a function that takes exactly the -// desired arguments: +// The callback is normally called with three arguments: +// callback(value, index, Array) +// If you want to call with only one argument, use: math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3'] ``` diff --git a/docs/reference/functions/parser.md b/docs/reference/functions/parser.md index baf5a3601..b7627b252 100644 --- a/docs/reference/functions/parser.md +++ b/docs/reference/functions/parser.md @@ -52,7 +52,7 @@ parser.evaluate('f(x, y) = x^y') // f(x, y) parser.evaluate('f(2, 3)') // 8 // get and set variables and functions -const x = parser.get('x') // 7 +const x = parser.get('x') // 3.5 const f = parser.get('f') // function const g = f(3, 2) // 9 parser.set('h', 500) diff --git a/docs/reference/functions/polynomialRoot.md b/docs/reference/functions/polynomialRoot.md index 0cfdad2f4..58562bc57 100644 --- a/docs/reference/functions/polynomialRoot.md +++ b/docs/reference/functions/polynomialRoot.md @@ -14,7 +14,7 @@ formulas for the roots.

Syntax #

```js -polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff) +math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff) ```

Parameters #

diff --git a/docs/reference/functions/rationalize.md b/docs/reference/functions/rationalize.md index e16a8ed12..5fbc1915c 100644 --- a/docs/reference/functions/rationalize.md +++ b/docs/reference/functions/rationalize.md @@ -15,10 +15,10 @@ exponents, returning the coefficients of numerator.

Syntax #

```js -rationalize(expr) -rationalize(expr, detailed) -rationalize(expr, scope) -rationalize(expr, scope, detailed) +math.rationalize(expr) +math.rationalize(expr, detailed) +math.rationalize(expr, scope) +math.rationalize(expr, scope, detailed) ```

Parameters #

diff --git a/docs/reference/functions/resolve.md b/docs/reference/functions/resolve.md index 6d7e4cd7a..039beb6d5 100644 --- a/docs/reference/functions/resolve.md +++ b/docs/reference/functions/resolve.md @@ -12,7 +12,7 @@ resolve(expr, scope) replaces variable nodes with their scoped values

Syntax #

```js -resolve(expr, scope) +math.resolve(expr, scope) ```

Parameters #

diff --git a/docs/reference/functions/simplify.md b/docs/reference/functions/simplify.md index 993e11f93..3c17ba88d 100644 --- a/docs/reference/functions/simplify.md +++ b/docs/reference/functions/simplify.md @@ -92,13 +92,13 @@ For more details on the theory, see:

Syntax #

```js -simplify(expr) -simplify(expr, rules) -simplify(expr, rules) -simplify(expr, rules, scope) -simplify(expr, rules, scope, options) -simplify(expr, scope) -simplify(expr, scope, options) +math.simplify(expr) +math.simplify(expr, rules) +math.simplify(expr, rules) +math.simplify(expr, rules, scope) +math.simplify(expr, rules, scope, options) +math.simplify(expr, scope) +math.simplify(expr, scope, options) ```

Parameters #

diff --git a/docs/reference/functions/simplifyConstant.md b/docs/reference/functions/simplifyConstant.md index 7db157f51..d8be7c1cc 100644 --- a/docs/reference/functions/simplifyConstant.md +++ b/docs/reference/functions/simplifyConstant.md @@ -15,8 +15,8 @@ value of that subexpression.

Syntax #

```js -simplifyConstant(expr) -simplifyConstant(expr, options) +math.simplifyConstant(expr) +math.simplifyConstant(expr, options) ```

Parameters #

diff --git a/docs/reference/functions/simplifyCore.md b/docs/reference/functions/simplifyCore.md index f25b0c5d8..d7a4b611a 100644 --- a/docs/reference/functions/simplifyCore.md +++ b/docs/reference/functions/simplifyCore.md @@ -32,8 +32,8 @@ Specifically, simplifyCore:

Syntax #

```js -simplifyCore(expr) -simplifyCore(expr, options) +math.simplifyCore(expr) +math.simplifyCore(expr, options) ```

Parameters #

diff --git a/docs/reference/functions/sqrtm.md b/docs/reference/functions/sqrtm.md index fbcf3b1f8..6ba64f4d5 100644 --- a/docs/reference/functions/sqrtm.md +++ b/docs/reference/functions/sqrtm.md @@ -15,7 +15,7 @@ https://en.wikipedia.org/wiki/Square_root_of_a_matrix

Syntax #

```js -X = math.sqrtm(A) +math.sqrtm(A) ```

Parameters #

diff --git a/docs/reference/functions/symbolicEqual.md b/docs/reference/functions/symbolicEqual.md index 7e8900667..e87d50204 100644 --- a/docs/reference/functions/symbolicEqual.md +++ b/docs/reference/functions/symbolicEqual.md @@ -23,8 +23,8 @@ simplifies down to 0. So there are two important caveats:

Syntax #

```js -symbolicEqual(expr1, expr2) -symbolicEqual(expr1, expr2, options) +math.symbolicEqual(expr1, expr2) +math.symbolicEqual(expr1, expr2, options) ```

Parameters #

@@ -51,11 +51,11 @@ Type | Description

Examples #

```js -symbolicEqual('x*y', 'y*x') // Returns true -symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false -symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true -symbolicEqual('abs(x)','x') // Returns false -symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true +math.symbolicEqual('x*y', 'y*x') // Returns true +math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false +math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true +math.symbolicEqual('abs(x)','x') // Returns false +math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true ``` diff --git a/download.md b/download.md index 630b3f9d9..8f60a19cb 100644 --- a/download.md +++ b/download.md @@ -27,7 +27,7 @@ Math.js can be downloaded or linked from various content delivery networks: unpkg - https://unpkg.com/mathjs@11.8.0/ + https://unpkg.com/mathjs@11.8.1/ cdnjs @@ -48,9 +48,9 @@ Or download the full bundle directly from [unpkg](https://unpkg.com):

math.js (version 11.8.0, 195 kB, minified and gzipped) - and if needed the source map + href="https://unpkg.com/mathjs@11.8.1/lib/browser/math.js" + >math.js (version 11.8.1, 195 kB, minified and gzipped) + and if needed the source map

Too large for you? Create your own [custom bundle](docs/custom_bundling.html). diff --git a/examples/browser/angle_configuration.html b/examples/browser/angle_configuration.html index 5b3839c6b..f3a8a08b6 100644 --- a/examples/browser/angle_configuration.html +++ b/examples/browser/angle_configuration.html @@ -15,7 +15,7 @@ } - + diff --git a/examples/browser/angle_configuration.html.md b/examples/browser/angle_configuration.html.md index 99b62a1f7..d213b8bcd 100644 --- a/examples/browser/angle_configuration.html.md +++ b/examples/browser/angle_configuration.html.md @@ -24,7 +24,7 @@ File: [angle_configuration.html](angle_configuration.html) (click for a live dem } - + diff --git a/examples/browser/basic_usage.html b/examples/browser/basic_usage.html index 6f447a168..62cde4fb0 100644 --- a/examples/browser/basic_usage.html +++ b/examples/browser/basic_usage.html @@ -3,7 +3,7 @@ math.js | basic usage - + diff --git a/examples/browser/basic_usage.html.md b/examples/browser/basic_usage.html.md index 7c9580b29..9bf8b819a 100644 --- a/examples/browser/basic_usage.html.md +++ b/examples/browser/basic_usage.html.md @@ -12,7 +12,7 @@ File: [basic_usage.html](basic_usage.html) (click for a live demo) math.js | basic usage - + diff --git a/examples/browser/currency_conversion.html b/examples/browser/currency_conversion.html index 12db9a808..b61a5dab9 100644 --- a/examples/browser/currency_conversion.html +++ b/examples/browser/currency_conversion.html @@ -4,7 +4,7 @@ math.js | currency conversion - + - + diff --git a/examples/browser/custom_separators.html.md b/examples/browser/custom_separators.html.md index a339c03ba..294ca0151 100644 --- a/examples/browser/custom_separators.html.md +++ b/examples/browser/custom_separators.html.md @@ -24,7 +24,7 @@ File: [custom_separators.html](custom_separators.html) (click for a live demo) } - + diff --git a/examples/browser/plot.html b/examples/browser/plot.html index f0ba4a67c..d89682388 100644 --- a/examples/browser/plot.html +++ b/examples/browser/plot.html @@ -3,7 +3,7 @@ math.js | plot - + diff --git a/examples/browser/plot.html.md b/examples/browser/plot.html.md index 2893ff897..7964904da 100644 --- a/examples/browser/plot.html.md +++ b/examples/browser/plot.html.md @@ -12,7 +12,7 @@ File: [plot.html](plot.html) (click for a live demo) math.js | plot - + diff --git a/examples/browser/pretty_printing_with_mathjax.html b/examples/browser/pretty_printing_with_mathjax.html index f52ad130a..5b8500df7 100644 --- a/examples/browser/pretty_printing_with_mathjax.html +++ b/examples/browser/pretty_printing_with_mathjax.html @@ -4,7 +4,7 @@ math.js | pretty printing with MathJax - + diff --git a/examples/browser/pretty_printing_with_mathjax.html.md b/examples/browser/pretty_printing_with_mathjax.html.md index c4d92e1ac..7ac454433 100644 --- a/examples/browser/pretty_printing_with_mathjax.html.md +++ b/examples/browser/pretty_printing_with_mathjax.html.md @@ -13,7 +13,7 @@ File: [pretty_printing_with_mathjax.html](pretty_printing_with_mathjax.html) (cl math.js | pretty printing with MathJax - + diff --git a/examples/browser/printing_html.html b/examples/browser/printing_html.html index 93292f800..ea2087ece 100644 --- a/examples/browser/printing_html.html +++ b/examples/browser/printing_html.html @@ -4,7 +4,7 @@ math.js | printing HTML - +