Skip to content

Commit

Permalink
Merge branch 'develop' into praisennamonu
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong authored Sep 20, 2023
2 parents 364408e + c35a801 commit cc9e109
Show file tree
Hide file tree
Showing 29 changed files with 700 additions and 100 deletions.
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Evan Miller <[email protected]>
Timur <[email protected]>
Ari Markowitz <[email protected]>
Jay Wang <[email protected]>
David Contreras <[email protected]
Jaeu Jeong <[email protected]>
cyavictor88 <[email protected]>
David Contreras <[email protected]>
Expand All @@ -230,5 +231,8 @@ Kiku <[email protected]>
MaybePixem <[email protected]>
Aly Khaled <[email protected]>
Praise Nnamonu <[email protected]>
BuildTools <[email protected]>
Anik Patel <[email protected]>
Vrushaket Chaudhari <[email protected]>

# Generated by tools/update-authors.js
27 changes: 26 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
# History

# unpublished changes since 11.9.1
# 2023-09-05, 11.11.0

- Implement function `corr` to calculate the correlation between two matrices
(#3015, #2624). Thanks @vrushaket.
- Lock `fraction.js` at version `4.3.4` for now, see #3024, 3022,
https://github.com/rawify/Fraction.js/issues/68.


# 2023-08-31, 11.10.1

- Upgrade to `[email protected]`, see #3022.
- Fix #3020: `lruQueue` using the global `hasOwnProperty` which may be
polluted.
- Add support for prefixes for the unit `erg`, and restrict prefixes of the
unit `joule` to only long prefixes like `kilo` and no short prefixes
like `k` (#3019). Thanks @costerwi.
- Add a new browser example `examples/browser/lorenz.html` that uses `solveODE`
and plots the result in a chart (#3018). Thanks @dvd101x.


# 2023-08-23, 11.10.0

- Extend function `quantileSeq` with support for a `dimension` (#3002).
Thanks @dvd101x.
- Implement #2735: Support indexing with an array of booleans, for
example `a[[true, false, true]]` and `a[a > 2]` (#2994). Thanks @dvd101x.
- Implement function `zeta` (#2950, #2975, #2904). Thanks @Bobingstern.
- Fix #2990: `DenseMatrix` can mutate input arrays (#2991).


Expand Down
2 changes: 1 addition & 1 deletion docs/datatypes/fractions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Fractions

For calculations with fractions, math.js supports a `Fraction` data type.
Fraction support is powered by [fraction.js](https://github.com/infusion/Fraction.js).
Fraction support is powered by [fraction.js](https://github.com/rawify/Fraction.js).
Unlike [numbers](numbers.md) and [BigNumbers](./bignumbers.md), fractions can
store numbers with infinitely repeating decimals, for example `1/3 = 0.3333333...`,
which can be represented as `0.(3)`, or `2/7` which can be represented as `0.(285714)`.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Stores values for a scalar unit and its postfix. (eg `100 mm` or `100 kg`). Alth
Stores values for a fractional number.

- [Overview](../datatypes/fractions.md)
- [Class API](https://github.com/infusion/Fraction.js/)
- [Class API](https://github.com/rawify/Fraction.js)

## BigNumber

Expand Down
53 changes: 53 additions & 0 deletions examples/browser/lorenz.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>math.js | Lorenz Attractor</title>
<script src="../../lib/browser/math.js"></script>

<script src="https://cdn.plot.ly/plotly-2.25.2.min.js" charset="utf-8"></script>
</head>

<body>
<div id="LorenzGraph"></div>
</body>
<script defer>

// define the constants for the Lorenz attractor
const sigma = 10
const beta = 2.7
const rho = 28

// solve the Lorenz attractor
const sol = math.solveODE(lorenz, [0, 100], [1, 1, 1])

// make colors that represents time differences in the solution
const diff = math.diff(sol.t)
const color = [diff[0], ...diff]

// render the plot using plotly
Plotly.newPlot('LorenzGraph',
[{
x: sol.y.map(u => u[0]),
y: sol.y.map(u => u[1]),
z: sol.y.map(u => u[2]),
line: { color, colorscale: 'Jet' },
type: "scatter3d",
mode: "lines"
}],
{ width: 800, height: 600 }
)

// define the lorenz attractor
function lorenz(t, u) {
const [x, y, z] = u
return [
sigma * (y - x),
x * (rho - z) - y,
x * y - beta * z
]
}
</script>

</html>
Loading

0 comments on commit cc9e109

Please sign in to comment.