Skip to content

Commit

Permalink
Release v1.5.0
Browse files Browse the repository at this point in the history
Added:
- comp.function(definition)
- comp.parse(str, init)
- comp.val(func, comp)
- comp.pow(comp, num)
- comp.invert(comp)
- comp.root(comp, n)
- plot.Taylor(func, n, a, scl, rgba, domain, origin, weight, res, context)
- calc.dfdz(func, comp)
- calc.d2fdz2(func, comp)
- calc.fzdz(func_1, func_2, a, b)
- calc.Taylor(func, val, n, a)

Removed:
- stat.gte(arr, arrORnum)
- stat.lte(arr, arrORnum)

Changed:
- comp.Re(funcORcomp)
- comp.Im(funcORcomp)
- comp.reciprocate(comp)
- plot.function(func, scl, rgba, domain, origin, weight)
- plot.barplot(arr, bins, scl, rgba, origin, weight, context)
- plot.lineplot(arr, bins, scl, rgba, origin, weight, context)
- plot.field(vec2field, scl, rgba, domain, origin, weight, res, context)
- trig.arctan2(y, x)
- stat.gt(arr, arrORnum, includeEnd)
- stat.lt(arr, arrORnum, includeEnd)
- stat.toObject(arr)
- calc.dfrdt(func_1, func_2, val)
- calc.frds(funcORvecfield, func, a, b)
  • Loading branch information
Zushah committed Dec 18, 2023
1 parent 0694a88 commit a2db4d1
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 48 deletions.
38 changes: 30 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
# Chalkboard changelog
All notable changes of every update of the Chalkboard library are recorded in this file.

## [v1.5.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.5.0) - 12/18/2023
The seventh release of the Chalkboard library.
Commits: [`v1.4.0...v1.5.0`](https://github.com/Zushah/Chalkboard/compare/v1.4.0...v1.5.0)
- Added Chalkboard as an npm package, so now it can be used on the server-side just like the client side
- Added `comp.function`, `comp.parse`, and `comp.val` to define, parse, and evaluate complex functions
- Added `calc.dfdz`, `calc.d2fdz2`, and `calc.fzdz` to calculate the first derivatives, second derivatives, and antiderivatives of complex functions
- Added approximations of functions using Taylor series with `calc.Taylor` and `plot.Taylor`
- Added `comp.pow` to calculate the exponentiation of a complex number
- Added `comp.root` to calculate the roots of a complex number
- Added `comp.invert` (calculates the multiplicative inverse of a complex number) to replace the functionality of `comp.reciprocate`
- Removed `stat.gte` and `stat.lte` and respectively incorporated their functionalities into `stat.gt` and `stat.lt`
- Changed `comp.reciprocate` to return the reciprocals of the components of a complex number instead of returning the multiplicative inverse of a complex number
- Changed `stat.gt` and `stat.lt` to have `includeEnd` parameters which determines whether the conditional they check for is "greater/less than" (input false) or "greater/less than or equal to" (input true)
- Changed `plot.barplot` and `plot.lineplot` to use the new functionalities of `stat.gt` and `stat.lt` instead of the removed `stat.gte` and `stat.lte`
- Changed `comp.Re` and `comp.Im` to respectively return the real and imaginary components of complex functions, too, instead of only the real and imaginary components of complex numbers
- Changed `stat.toObject` to return an object with its properties named based on the array's index instead of the array's element
- Changed `trig.arctan2` to use `Math.atan` instead of `trig.arctan` to be faster
- Changed the name of `calc.frdt` to `calc.frds`
- Changed `plot.function` to accept complex functions as inputs to plot their domain colorings
- Fixed the error messages in `calc.dfdrt` which were misspelled
- Fixed `plot.field` to include the upper bounds in its domain

## [v1.4.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.4.0) - 12/11/2023
The sixth release of the Chalkboard library.
Commits: [`v1.3.1...v1.4.0`](https://github.com/Zushah/Chalkboard/compare/v1.3.1...v1.4.0)
- Added many new commands for arrays: creating an array of random numbers, calculating different types of the norm (and the squared norm) of an array, calculating the normalized array, calculating the array that has the numbers that are equal to, greater than (or equal to), less than (or equal to), or some compound inequality of another number or array, calculating the skewness and kurtosis of an array, calculating the different quartiles of an array, and converting an array to a vector, matrix, object, string, or printing it in the console
- Added `plot.barplot`, `plot.lineplot`, and `plot.scatterplot` to plot arrays of data
- Added `.constrain` commands for numbers, arrays, complex numbers, quaternions, vectors, and matrices to constrain their values within a range
- Added `trig.arctan2` to calculate angles
- Added `trig.arctan2` to accurately calculate the angle between a vector and the positive x-axis
- Added `numb.sum` and `numb.mul` for the calculation of specified summation and product formulae
- Added `.reflect` and `.refract` commands for vectors to calculate reflection and refraction vectors
- Added `real.pingpong` to calculate the ping-pong function
Expand Down Expand Up @@ -41,14 +63,14 @@ Commits: [`v1.2.0...v1.3.0`](https://github.com/Zushah/Chalkboard/compare/v1.2.0
- Changed `matr.toVector` to have another optional parameter for the row/column of a matrix to define a vector from
- Added `comp.scl` and `quat.scl`, and changed all of the `.magset` commands to work using their respective `.scl` commands
- Added a `type` parameter to `stat.mean` to enable the calculation of different types of means: arithmetic, geometric, and harmonic
- Changed `real.function`, `real.parse`, `calc.dfdx`, and `calc.fxdx` to work for the new `"mult"` function type for multivariable functions, the new `"curv"` function type for parametric curves, and the new `"surf"` function type for parametric surfaces
- Changed all `plot` commands so they can now optionally have their opacity changed with the `rgba` parameter (which previously used to only be `rgb`)
- Changed `numb.Gaussian` to use `for(;;)` instead of `while(typeof x === "undefined")`
- Changed the name of `calc.average` to `calc.mean`
- Removed `geom.dist2D` and `geom.dist3D` and replaced them with `geom.dist` and `geom.distsq` which can calculate the distance between any-dimensional points
- Removed `vec2.rotate2D`, `vec3.rotatex`, `vec3.rotatey`, and `vec3.rotatez` because all vector rotations can be handled with rotation matrices
- Removed `matr.rotater2D` and `matr.rotater3D` and replaced them with `matr.rotater` which can do both 2D and 3D rotations depending on the number of parameters inputted (one parameter required for 2D rotations, three parameters required for 3D rotations)
- Removed `real.sqrt` from returning a complex number when the input is negative because it would sometimes cause bugs
- Changed `real.function`, `real.parse`, `calc.dfdx`, and `calc.fxdx` to work for the new `"mult"` function type for multivariable functions, the new `"curv"` function type for parametric curves, and the new `"surf"` function type for parametric surfaces
- Changed all `plot` commands so they can now optionally have their opacity changed with the `rgba` parameter (which previously used to only be `rgb`)
- Changed `numb.Gaussian` to use `for(;;)` instead of `while(typeof x === "undefined")`
- Changed the name of `calc.average` to `calc.mean`
- Fixed `matr.invert` returning `NaN` values when `0` is on the diagonal of a matrix, thanks to [@bhavjitChauhan](https://github.com/bhavjitChauhan).

## [v1.2.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.2.0) - 11/27/2023
Expand All @@ -57,12 +79,12 @@ Commits: [`v1.1.0...v1.2.0`](https://github.com/Zushah/Chalkboard/compare/v1.1.0
- Added new matrix commands for the trace of a matrix, the row space of a matrix, the column space, and null space, the exponentation, the row Echelon form (Gaussian elimination), solving systems of linear equations, and conversion of a matrix to an object
- Added `plot.comp`, `plot.vec2`, `plot.vec3`, and `plot.matr` to replace `comp.display`, `vec2.display`, `vec3.display`, and `matr.display`
- Added `numb.binomial` to calculate binomial coefficients
- Removed `vec2.fromNumber`, `vec3.angcos`, `vec4.angcos`, and `matr.dimension`
- Removed all of the `.addScl` (scalar addition) commands for vectors
- Changed all of the `matr` commands to work for matrices of any and all dimensions (previously there was a four-by-four dimension limit)
- Changed all of the `.mulScl` (scalar multiplication) commands for vectors and matrices to be renamed as `.scl`
- Changed `numb.random` to have both of its parameters be optional (no parameters inputted returns a random number between 0 and 1)
- Changed `numb.Gaussian` to use `while(typeof x === "undefined")` instead of `while(true)`
- Removed `vec2.fromNumber`, `vec3.angcos`, `vec4.angcos`, and `matr.dimension`
- Removed all of the `.addScl` (scalar addition) commands for vectors
- Fixed the `vec2.magset` and `vec3.magset` commands which would return vectors in the wrong dimensions

## [v1.1.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.1.0) - 11/13/2023
Expand All @@ -74,6 +96,7 @@ Commits: [`v1.0.0...v1.1.0`](https://github.com/Zushah/Chalkboard/compare/v1.0.0
- Added `.convolution`, `.correlation`, and `.autocorrelation` commands in the `stat`, `calc`, and `plot` categories to calculate and plot the discrete and continuous convolutions, cross-correlations, and autocorrelations of arrays and functions, respectively
- Added `stat.error` to calculate the standard error of an array
- Added `matr.cofactor` and `matr.adjugate` to calculate the cofactor and adjugate matrices of a matrix
- Removed `calc.rOdO` because polar differentation can now be done with `calc.fxdx` instead
- Changed `calc.fxdx` to work using Simpson's rule instead of the trapezoidal Riemann sum
- Changed `real.val`, `calc.dfdx`, and `calc.fxdx` to work for all Chalkboard functions regardless of their `type` (before they only worked for `"expl"` functions)
- Changed `matr.det` and `matr.transpose` to work for all matrices regardless of their dimension
Expand All @@ -82,7 +105,6 @@ Commits: [`v1.0.0...v1.1.0`](https://github.com/Zushah/Chalkboard/compare/v1.0.0
- Changed `plot.function` and `numb.factorial` to be more written slightly more efficiently
- Changed the name of the `position` parameter in `stat.Gaussian` to `mean`
- Changed the name of `numb.prime` (the command that checks if a number is prime) to `numb.isPrime`, so parts of `numb.primeArr` and `prime.compositeArr` had to be changed, too
- Removed `calc.rOdO` because polar differentation can now be done with `calc.fxdx` instead

## [v1.0.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.0.0) - 11/06/2023
The first release of the Chalkboard library.
Expand Down
53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p align="center"><a href="https://www.github.com/Zushah/Chalkboard"><img src="./assets/logo.png" width="50%"></a></p>
<p align="center"><a href="https://www.github.com/Zushah/Chalkboard"><img src="./assets/Chalkboard-logo.png" width="50%"></a></p>
<p align="center">
<a href="https://www.github.com/Zushah/Chalkboard/releases/tag/v1.3.1"><img src="https://img.shields.io/github/v/release/Zushah/Chalkboard" alt="Latest release"></a>
<a href="https://www.github.com/Zushah/Chalkboard/releases/tag/v1.5.0"><img src="https://img.shields.io/github/v/release/Zushah/Chalkboard" alt="Latest release"></a>
<a href="https://www.codefactor.io/repository/github/zushah/chalkboard"><img src="https://www.codefactor.io/repository/github/zushah/chalkboard/badge" alt="CodeFactor grade"></a>
<a href="https://www.github.com/Zushah/Chalkboard/commits"><img src="https://img.shields.io/github/last-commit/Zushah/Chalkboard" alt="Last commit"></a>
<a href="/Zushah/Chalkboard/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow" alt="Minified size"></a>
<a href="https://www.jsdelivr.com/package/gh/Zushah/Chalkboard?path=build"><img src="https://data.jsdelivr.com/v1/package/gh/Zushah/Chalkboard/badge" alt="JSDelivr traffic"></a>
<a href="https://www.npmjs.com/package/@zushah/chalkboard"><img src="https://img.shields.io/badge/node-v20.10.0-limegreen" alt="Node.js support"></a>
<a href="/Zushah/Chalkboard/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-yellow" alt="MIT License"></a>
<a href="https://www.jsdelivr.com/package/gh/Zushah/Chalkboard"><img src="https://data.jsdelivr.com/v1/package/gh/Zushah/Chalkboard/badge" alt="JSDelivr requests"></a>
<br>
<a href="https://zushah.github.io/Chalkboard/home.html">https://zushah.github.io/Chalkboard/home.html</a>
</p>
Expand All @@ -21,22 +21,26 @@
</ol>

# About
The Chalkboard library is a JavaScript namespace that provides a plethora of both practical and abstract mathematical functionalities for its user. It was developed by [Zushah](https://www.github.com/Zushah) during 2022 and 2023 and then [released](https://github.com/Zushah/Chalkboard/releases/tag/v1.0.0) on November 6, 2023. As per the latest release of [v1.4.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.4.0), Chalkboard has 422 different commands. The library is available for regular JavaScript as well as [Proccesing.js](https://www.processing.org/) (fully compatible with [Khan Academy](https://www.khanacademy.org/cs/chalkboard/6708642430369792)). Chalkboard's website can be visited [here](https://zushah.github.io/Chalkboard/home.html).
The Chalkboard library is a JavaScript namespace that provides a plethora of both practical and abstract mathematical functionalities for its user. It was developed by [Zushah](https://www.github.com/Zushah) during 2022 and 2023 and then [released](https://github.com/Zushah/Chalkboard/releases/tag/v1.0.0) on November 6, 2023. As per the latest release of [v1.5.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.5.0), Chalkboard has 431 different commands. The library is available for regular JavaScript on both the client-side and the server-side as well as [Proccesing.js](https://www.processing.org/) (fully compatible with [Khan Academy](https://www.khanacademy.org/cs/chalkboard/6708642430369792)). Chalkboard's website can be visited [here](https://zushah.github.io/Chalkboard/home.html).

# Installation
If your JavaScript project is being run within an HTML webpage, you can import the latest version of the Chalkboard library into it with this line:
If your JavaScript project is being run on the client-side within a webpage, you can install Chalkboard with this HTML tag:
```html
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Zushah/Chalkboard@1.4.0/src/Chalkboard.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Zushah/Chalkboard@1.5.0/src/Chalkboard.min.js"></script>
```
Alternatively, you can simply download the [latest release](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.4.0) and put the relevant files in your project's directory.
If your JavaScript project is being run on the server-side within the [Node.js](https://nodejs.org/en) environment, you can install Chalkboard with this console command:
```bash
npm install @zushah/chalkboard@1.5.0
```
Alternatively, you can simply download the [latest release](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.5.0) and put the relevant files in your project's directory.

More methods and details about installing Chalkboard can be read [here](https://zushah.github.io/Chalkboard/installation.html).

# Documentation
These are all thirteen Chalkboard categories with a brief description of what they're mostly about, and listed in the order they appear in the source code:
- `numb` - Number-theory-related operations
- `real` - Real-valued function operations
- `comp` - Complex number operations
- `real` - Real number and real function operations
- `comp` - Complex number and complex function operations
- `quat` - Quaternion operations
- `plot` - Plotting functions, complex numbers, vectors, matrices, and statistical graphs
- `geom` - Geometric formulae operations
Expand All @@ -61,9 +65,14 @@ After installing Chalkboard into your program, you can immediately get started w
```js
Chalkboard.category.command(parameters);
```
Here is some code that shows off only a few basic features of Chalkboard:
Here is some code that shows off only a few features of Chalkboard:
```js
const cb = Chalkboard; // Chalkboard is a nice name but it's also long
/*
Note that this code is written on the client-side
You can write all the same code on the server-side, too, but you would have to replace the line above with:
const cb = require("@zushah/chalkboard@1.5.0");
*/

let f = cb.real.function("Math.cos(2 * x)"); // f(x) = cos(2x)
let dfdx = cb.calc.dfdx(f, 2); // Derivative of f at x = 0
Expand All @@ -79,11 +88,13 @@ let midPrime = cb.stat.median(primes); // Median number in the primes array
cb.plot.barplot(primes, cb.stat.array(0, 100, 11), 5, [[0, 0, 0], [0, 0, 255]]); // Barplot of the primes array with a bin size of 10, a scale of 2, a stroke color of black, and a fill color of blue

let z = cb.comp.new(1, 1); // z = 1 + i
let zsqsqrt = cb.comp.sqrt(cb.comp.sq(z)); // The square root of z squared
let zsqsqrt = cb.comp.sqrt(cb.comp.sq(z)); // The square root of z squared equals z
let f = cb.comp.function("a*a - b*b + 1", "2*a*b"); // f(z) = z^2 + 1 for z = a + bi (a complex-valued function)
cb.plot.function(f); // Plots the domain coloring of f

let r = cb.real.function(["Math.cos(t)", "Math.sin(t)"], "curv"); // r(t) = (cos(t), sin(t))
cb.plot.xyplane(2); // Draws the Cartesian coordinate plane
cb.plot.function(r, 2, [0, cb.PI(1/2)]); // Plots r(t) from t = 0 to t = π/2
cb.plot.function(r, 2, [255, 0, 0] [0, cb.PI(1/2)]); // Plots r(t) colored red from t = 0 to t = π/2

let a = cb.vec3.new(1, 2, 3); // Vector a = (1, 2, 3)
let b = cb.vec3.new(4, 5, 6); // Vector b = (4, 5, 6)
Expand All @@ -100,16 +111,13 @@ let mi = cb.matr.invert(m); // mi is the inverse of m
let mmi = cb.matr.mul(m, mi); // mmi is the product of m and mi
cb.matr.print(mmi); // Prints mmi in the console
```
More examples (which are more interesting) can be seen [here](https://zushah.github.io/Chalkboard/examples.html) with their source code [here](https://github.com/Zushah/Chalkboard/tree/main/examples).
More examples that are more interesting can be seen [here](https://zushah.github.io/Chalkboard/examples.html) with their source code [here](https://github.com/Zushah/Chalkboard/tree/main/examples).

# Contributing
<ol>
<li>Clone or fork Chalkboard's GitHub repository.</li>
<li>If you cloned the repository, pull the latest code and make a new branch based on the main branch. If you forked it, then just make sure it's based on the main branch.</li>
<li>Make your contributions to your branch or fork.</li>
<li>If you're adding new features or modifying the functionalities of old ones, please make sure you do the same for both editions (JavaScript and Processing.js) of the library.</li>
<li>When you're done, commit the changes to your branch or fork with a detailed description.</li>
<li>Publish your branch or fork to GitHub.</li>
<li>Fork Chalkboard's GitHub repository. Make sure the fork is based on the main branch.</li>
<li>Make your contributions to your fork. If you're adding new features or modifying the functionalities of old ones, please make sure you do the same for both editions (JavaScript and Processing.js) of the library.</li>
<li>When you're done, commit the changes to your fork with a detailed description.</li>
<li>Open a pull request. It will be reviewed soon and then merged to the main branch.</li>
</ol>

Expand All @@ -118,7 +126,8 @@ The changelog can be read [here](https://github.com/Zushah/Chalkboard/blob/main/
The Chalkboard library is available under the [MIT License](https://github.com/Zushah/Chalkboard/blob/main/LICENSE.md).

# Acknowledgements
Thanks to [Bhavjit Chauhan](https://github.com/bhavjitChauhan) for his [contribution](https://github.com/Zushah/Chalkboard/commit/d3f0a82f0c2b1351f391908ef2d6f78403881259) to [v1.3.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.3.0).
Thanks to [Bhavjit Chauhan](https://github.com/bhavjitChauhan) for his [contribution](https://www.github.com/Zushah/Chalkboard/pull/1) to [v1.3.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.3.0).\
Thanks to [G. Yang](https://www.github.com/gyang0) for his [contribution](https://www.github.com/Zushah/zushah.github.io/pull/1) to the [documentation](https://www.github.com/Zushah/zushah.github.io/tree/main/Chalkboard).

# Contact
[GitHub](https://www.github.com/Zushah)\
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Chalkboard documentation
The documentation for [Chalkboard v1.4.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.4.0) can be visited [here](https://zushah.github.io/Chalkboard/documentation.html/). Its source code is located [here](https://github.com/Zushah/zushah.github.io/blob/main/Chalkboard/documentation.html).
The documentation for [Chalkboard v1.5.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.5.0) can be visited [here](https://zushah.github.io/Chalkboard/documentation.html/). Its source code is located [here](https://github.com/Zushah/zushah.github.io/blob/main/Chalkboard/documentation.html).
Loading

0 comments on commit a2db4d1

Please sign in to comment.