@zushah/chalkboard 2.3.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -1,21 +1,328 @@
1
- MIT License
2
-
3
- Copyright (c) 2023-2025 Zushah
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Mozilla Public License, version 2.0
2
+
3
+ 1. Definitions
4
+
5
+ 1.1. “Contributor”
6
+ means each individual or legal entity that creates, contributes to the
7
+ creation of, or owns Covered Software.
8
+
9
+ 1.2. “Contributor Version”
10
+ means the combination of the Contributions of others (if any) used by a
11
+ Contributor and that particular Contributor’s Contribution.
12
+
13
+ 1.3. “Contribution”
14
+ means Covered Software of a particular Contributor.
15
+
16
+ 1.4. “Covered Software”
17
+ means Source Code Form to which the initial Contributor has attached the
18
+ notice in Exhibit A, the Executable Form of such Source Code Form,
19
+ and Modifications of such Source Code Form, in each case
20
+ including portions thereof.
21
+
22
+ 1.5. “Incompatible With Secondary Licenses”
23
+ means
24
+
25
+ a. that the initial Contributor has attached the notice described
26
+ in Exhibit B to the Covered Software; or
27
+
28
+ b. that the Covered Software was made available under the terms of
29
+ version 1.1 or earlier of the License, but not also under the terms
30
+ of a Secondary License.
31
+
32
+ 1.6. “Executable Form”
33
+ means any form of the work other than Source Code Form.
34
+
35
+ 1.7. “Larger Work”
36
+ means a work that combines Covered Software with other material,
37
+ in a separate file or files, that is not Covered Software.
38
+
39
+ 1.8. “License”
40
+ means this document.
41
+
42
+ 1.9. “Licensable”
43
+ means having the right to grant, to the maximum extent possible,
44
+ whether at the time of the initial grant or subsequently,
45
+ any and all of the rights conveyed by this License.
46
+
47
+ 1.10. “Modifications”
48
+ means any of the following:
49
+
50
+ a. any file in Source Code Form that results from an addition to,
51
+ deletion from, or modification of the contents of Covered Software; or
52
+
53
+ b. any new file in Source Code Form that contains any Covered Software.
54
+
55
+ 1.11. “Patent Claims” of a Contributor
56
+ means any patent claim(s), including without limitation, method, process,
57
+ and apparatus claims, in any patent Licensable by such Contributor that
58
+ would be infringed, but for the grant of the License, by the making,
59
+ using, selling, offering for sale, having made, import, or transfer of
60
+ either its Contributions or its Contributor Version.
61
+
62
+ 1.12. “Secondary License”
63
+ means either the GNU General Public License, Version 2.0, the
64
+ GNU Lesser General Public License, Version 2.1, the GNU Affero General
65
+ Public License, Version 3.0, or any later versions of those licenses.
66
+
67
+ 1.13. “Source Code Form”
68
+ means the form of the work preferred for making modifications.
69
+
70
+ 1.14. “You” (or “Your”)
71
+ means an individual or a legal entity exercising rights under this License.
72
+ For legal entities, “You” includes any entity that controls,
73
+ is controlled by, or is under common control with You. For purposes of
74
+ this definition, “control” means (a) the power, direct or indirect,
75
+ to cause the direction or management of such entity, whether by contract
76
+ or otherwise, or (b) ownership of more than fifty percent (50%) of the
77
+ outstanding shares or beneficial ownership of such entity.
78
+
79
+ 2. License Grants and Conditions
80
+
81
+ 2.1. Grants
82
+ Each Contributor hereby grants You a world-wide, royalty-free,
83
+ non-exclusive license:
84
+
85
+ a. under intellectual property rights (other than patent or trademark)
86
+ Licensable by such Contributor to use, reproduce, make available,
87
+ modify, display, perform, distribute, and otherwise exploit its
88
+ Contributions, either on an unmodified basis, with Modifications,
89
+ or as part of a Larger Work; and
90
+
91
+ b. under Patent Claims of such Contributor to make, use, sell,
92
+ offer for sale, have made, import, and otherwise transfer either
93
+ its Contributions or its Contributor Version.
94
+
95
+ 2.2. Effective Date
96
+ The licenses granted in Section 2.1 with respect to any Contribution
97
+ become effective for each Contribution on the date the Contributor
98
+ first distributes such Contribution.
99
+
100
+ 2.3. Limitations on Grant Scope
101
+ The licenses granted in this Section 2 are the only rights granted
102
+ under this License. No additional rights or licenses will be implied
103
+ from the distribution or licensing of Covered Software under this License.
104
+ Notwithstanding Section 2.1(b) above, no patent license is granted
105
+ by a Contributor:
106
+
107
+ a. for any code that a Contributor has removed from
108
+ Covered Software; or
109
+
110
+ b. for infringements caused by: (i) Your and any other third party’s
111
+ modifications of Covered Software, or (ii) the combination of its
112
+ Contributions with other software (except as part of its
113
+ Contributor Version); or
114
+
115
+ c. under Patent Claims infringed by Covered Software in the
116
+ absence of its Contributions.
117
+
118
+ This License does not grant any rights in the trademarks, service marks,
119
+ or logos of any Contributor (except as may be necessary to comply with
120
+ the notice requirements in Section 3.4).
121
+
122
+ 2.4. Subsequent Licenses
123
+ No Contributor makes additional grants as a result of Your choice to
124
+ distribute the Covered Software under a subsequent version of this
125
+ License (see Section 10.2) or under the terms of a Secondary License
126
+ (if permitted under the terms of Section 3.3).
127
+
128
+ 2.5. Representation
129
+ Each Contributor represents that the Contributor believes its
130
+ Contributions are its original creation(s) or it has sufficient rights
131
+ to grant the rights to its Contributions conveyed by this License.
132
+
133
+ 2.6. Fair Use
134
+ This License is not intended to limit any rights You have under
135
+ applicable copyright doctrines of fair use, fair dealing,
136
+ or other equivalents.
137
+
138
+ 2.7. Conditions
139
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the
140
+ licenses granted in Section 2.1.
141
+
142
+ 3. Responsibilities
143
+
144
+ 3.1. Distribution of Source Form
145
+ All distribution of Covered Software in Source Code Form, including
146
+ any Modifications that You create or to which You contribute, must be
147
+ under the terms of this License. You must inform recipients that the
148
+ Source Code Form of the Covered Software is governed by the terms
149
+ of this License, and how they can obtain a copy of this License.
150
+ You may not attempt to alter or restrict the recipients’ rights
151
+ in the Source Code Form.
152
+
153
+ 3.2. Distribution of Executable Form
154
+ If You distribute Covered Software in Executable Form then:
155
+
156
+ a. such Covered Software must also be made available in Source Code
157
+ Form, as described in Section 3.1, and You must inform recipients of
158
+ the Executable Form how they can obtain a copy of such Source Code
159
+ Form by reasonable means in a timely manner, at a charge no more than
160
+ the cost of distribution to the recipient; and
161
+
162
+ b. You may distribute such Executable Form under the terms of this
163
+ License, or sublicense it under different terms, provided that the
164
+ license for the Executable Form does not attempt to limit or alter
165
+ the recipients’ rights in the Source Code Form under this License.
166
+
167
+ 3.3. Distribution of a Larger Work
168
+ You may create and distribute a Larger Work under terms of Your choice,
169
+ provided that You also comply with the requirements of this License for
170
+ the Covered Software. If the Larger Work is a combination of
171
+ Covered Software with a work governed by one or more Secondary Licenses,
172
+ and the Covered Software is not Incompatible With Secondary Licenses,
173
+ this License permits You to additionally distribute such Covered Software
174
+ under the terms of such Secondary License(s), so that the recipient of
175
+ the Larger Work may, at their option, further distribute the
176
+ Covered Software under the terms of either this License or such
177
+ Secondary License(s).
178
+
179
+ 3.4. Notices
180
+ You may not remove or alter the substance of any license notices
181
+ (including copyright notices, patent notices, disclaimers of warranty,
182
+ or limitations of liability) contained within the Source Code Form of
183
+ the Covered Software, except that You may alter any license notices to
184
+ the extent required to remedy known factual inaccuracies.
185
+
186
+ 3.5. Application of Additional Terms
187
+ You may choose to offer, and to charge a fee for, warranty, support,
188
+ indemnity or liability obligations to one or more recipients of
189
+ Covered Software. However, You may do so only on Your own behalf,
190
+ and not on behalf of any Contributor. You must make it absolutely clear
191
+ that any such warranty, support, indemnity, or liability obligation is
192
+ offered by You alone, and You hereby agree to indemnify every Contributor
193
+ for any liability incurred by such Contributor as a result of warranty,
194
+ support, indemnity or liability terms You offer. You may include
195
+ additional disclaimers of warranty and limitations of liability
196
+ specific to any jurisdiction.
197
+
198
+ 4. Inability to Comply Due to Statute or Regulation
199
+
200
+ If it is impossible for You to comply with any of the terms of this License
201
+ with respect to some or all of the Covered Software due to statute,
202
+ judicial order, or regulation then You must: (a) comply with the terms of
203
+ this License to the maximum extent possible; and (b) describe the limitations
204
+ and the code they affect. Such description must be placed in a text file
205
+ included with all distributions of the Covered Software under this License.
206
+ Except to the extent prohibited by statute or regulation, such description
207
+ must be sufficiently detailed for a recipient of ordinary skill
208
+ to be able to understand it.
209
+
210
+ 5. Termination
211
+
212
+ 5.1. The rights granted under this License will terminate automatically
213
+ if You fail to comply with any of its terms. However, if You become
214
+ compliant, then the rights granted under this License from a particular
215
+ Contributor are reinstated (a) provisionally, unless and until such
216
+ Contributor explicitly and finally terminates Your grants, and (b) on an
217
+ ongoing basis, if such Contributor fails to notify You of the
218
+ non-compliance by some reasonable means prior to 60 days after You have
219
+ come back into compliance. Moreover, Your grants from a particular
220
+ Contributor are reinstated on an ongoing basis if such Contributor
221
+ notifies You of the non-compliance by some reasonable means,
222
+ this is the first time You have received notice of non-compliance with
223
+ this License from such Contributor, and You become compliant prior to
224
+ 30 days after Your receipt of the notice.
225
+
226
+ 5.2. If You initiate litigation against any entity by asserting a patent
227
+ infringement claim (excluding declaratory judgment actions,
228
+ counter-claims, and cross-claims) alleging that a Contributor Version
229
+ directly or indirectly infringes any patent, then the rights granted
230
+ to You by any and all Contributors for the Covered Software under
231
+ Section 2.1 of this License shall terminate.
232
+
233
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
234
+ end user license agreements (excluding distributors and resellers) which
235
+ have been validly granted by You or Your distributors under this License
236
+ prior to termination shall survive termination.
237
+
238
+ 6. Disclaimer of Warranty
239
+
240
+ Covered Software is provided under this License on an “as is” basis, without
241
+ warranty of any kind, either expressed, implied, or statutory, including,
242
+ without limitation, warranties that the Covered Software is free of defects,
243
+ merchantable, fit for a particular purpose or non-infringing. The entire risk
244
+ as to the quality and performance of the Covered Software is with You.
245
+ Should any Covered Software prove defective in any respect, You
246
+ (not any Contributor) assume the cost of any necessary servicing, repair,
247
+ or correction. This disclaimer of warranty constitutes an essential part of
248
+ this License. No use of any Covered Software is authorized under this
249
+ License except under this disclaimer.
250
+
251
+ 7. Limitation of Liability
252
+
253
+ Under no circumstances and under no legal theory, whether tort
254
+ (including negligence), contract, or otherwise, shall any Contributor, or
255
+ anyone who distributes Covered Software as permitted above, be liable to
256
+ You for any direct, indirect, special, incidental, or consequential damages
257
+ of any character including, without limitation, damages for lost profits,
258
+ loss of goodwill, work stoppage, computer failure or malfunction, or any and
259
+ all other commercial damages or losses, even if such party shall have been
260
+ informed of the possibility of such damages. This limitation of liability
261
+ shall not apply to liability for death or personal injury resulting from
262
+ such party’s negligence to the extent applicable law prohibits such
263
+ limitation. Some jurisdictions do not allow the exclusion or limitation of
264
+ incidental or consequential damages, so this exclusion and limitation may
265
+ not apply to You.
266
+
267
+ 8. Litigation
268
+
269
+ Any litigation relating to this License may be brought only in the courts of
270
+ a jurisdiction where the defendant maintains its principal place of business
271
+ and such litigation shall be governed by laws of that jurisdiction, without
272
+ reference to its conflict-of-law provisions. Nothing in this Section shall
273
+ prevent a party’s ability to bring cross-claims or counter-claims.
274
+
275
+ 9. Miscellaneous
276
+
277
+ This License represents the complete agreement concerning the subject matter
278
+ hereof. If any provision of this License is held to be unenforceable,
279
+ such provision shall be reformed only to the extent necessary to make it
280
+ enforceable. Any law or regulation which provides that the language of a
281
+ contract shall be construed against the drafter shall not be used to construe
282
+ this License against a Contributor.
283
+
284
+ 10. Versions of the License
285
+
286
+ 10.1. New Versions
287
+ Mozilla Foundation is the license steward. Except as provided in
288
+ Section 10.3, no one other than the license steward has the right to
289
+ modify or publish new versions of this License. Each version will be
290
+ given a distinguishing version number.
291
+
292
+ 10.2. Effect of New Versions
293
+ You may distribute the Covered Software under the terms of the version
294
+ of the License under which You originally received the Covered Software,
295
+ or under the terms of any subsequent version published
296
+ by the license steward.
297
+
298
+ 10.3. Modified Versions
299
+ If you create software not governed by this License, and you want to
300
+ create a new license for such software, you may create and use a modified
301
+ version of this License if you rename the license and remove any
302
+ references to the name of the license steward (except to note that such
303
+ modified license differs from this License).
304
+
305
+ 10.4. Distributing Source Code Form that is
306
+ Incompatible With Secondary Licenses
307
+ If You choose to distribute Source Code Form that is
308
+ Incompatible With Secondary Licenses under the terms of this version of
309
+ the License, the notice described in Exhibit B of this
310
+ License must be attached.
311
+
312
+ Exhibit A - Source Code Form License Notice
313
+
314
+ This Source Code Form is subject to the terms of the
315
+ Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
316
+ with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
317
+
318
+ If it is not possible or desirable to put the notice in a particular file,
319
+ then You may include the notice in a location (such as a LICENSE file in a
320
+ relevant directory) where a recipient would be likely to
321
+ look for such a notice.
322
+
323
+ You may add additional accurate notices of copyright ownership.
324
+
325
+ Exhibit B - “Incompatible With Secondary Licenses” Notice
326
+
327
+ This Source Code Form is “Incompatible With Secondary Licenses”,
328
+ as defined by the Mozilla Public License, v. 2.0.
package/README.md CHANGED
@@ -1,69 +1,69 @@
1
- <p align="center"><a href="https://www.github.com/Zushah/Chalkboard"><img src="https://raw.githubusercontent.com/Zushah/Chalkboard/main/assets/Chalkboard-logo.png" width="50%"></a></p>
1
+ <p align="center"><a href="https://www.github.com/Zushah/Chalkboard"><img src="https://raw.githubusercontent.com/Zushah/Chalkboard/main/assets/logo.png" width="50%"></a></p>
2
2
  <p align="center">
3
- <a href="https://www.github.com/Zushah/Chalkboard/releases/tag/v2.3.0"><img src="https://img.shields.io/badge/release-v2.3.0_Boole-blueviolet?logo=github&logoColor=white" alt="Latest release"></a>
4
- <a href="https://www.github.com/microsoft/TypeScript"><img src="https://img.shields.io/github/languages/top/Zushah/Chalkboard?color=blue&logo=typescript&logoColor=white" alt="Written in TypeScript"></a>
5
- <a href="https://www.codefactor.io/repository/github/zushah/chalkboard"><img src="https://img.shields.io/codefactor/grade/github/Zushah/Chalkboard?color=darkgreen&logo=codefactor&logoColor=white" alt="CodeFactor grade"></a>
6
- <a href="https://www.npmjs.com/package/@zushah/chalkboard"><img src="https://img.shields.io/npm/dm/%40zushah/chalkboard?logo=npm&logoColor=white" alt="npm downloads"></a>
7
- <a href="https://www.github.com/Zushah/Chalkboard/blob/main/LICENSE.md"><img src="https://img.shields.io/github/license/Zushah/Chalkboard?color=yellow&logo=opensourceinitiative&logoColor=white" alt="MIT License"></a>
8
- <a href="https://bundlephobia.com/package/@zushah/chalkboard@2.3.0"><img src="https://img.shields.io/bundlephobia/min/%40zushah/chalkboard?color=orange&logo=files&logoColor=white" alt="Minified size"></a>
9
- <a href="https://www.jsdelivr.com/package/gh/Zushah/Chalkboard"><img src="https://img.shields.io/jsdelivr/gh/hm/Zushah/Chalkboard?color=crimson&logo=jsdelivr&logoColor=white" alt="jsDelivr requests"></a>
3
+ <a href="https://www.github.com/Zushah/Chalkboard/releases/tag/v3.0.0"><img src="https://img.shields.io/badge/release-v3.0.0_Euler-blueviolet?logo=github&logoColor=white" alt="Latest release"></a>
4
+ <a href="https://raw.githubusercontent.com/Zushah/Chalkboard/v3.0.0/dist/Chalkboard.js"><img src="https://img.shields.io/badge/minified-290.75_kB-blue?logo=javascript&logoColor=white" alt="290.75 kilobytes minified size"></a>
5
+ <a href="https://www.npmjs.com/package/@zushah/chalkboard"><img src="https://img.shields.io/npm/dm/%40zushah/chalkboard?logo=npm&logoColor=white" alt="npm downloads per month"></a>
6
+ <a href="https://www.jsdelivr.com/package/gh/Zushah/Chalkboard"><img src="https://img.shields.io/jsdelivr/gh/hm/Zushah/Chalkboard?color=yellow&logo=jsdelivr&logoColor=white" alt="jsDelivr requests per month"></a>
7
+ <a href="https://www.github.com/Zushah/Chalkboard/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/license-MPL--2.0-crimson?logo=gitbook&logoColor=white" alt="Mozilla Public License 2.0"></a>
10
8
  <br>
11
9
  <a href="https://zushah.github.io/Chalkboard">https://zushah.github.io/Chalkboard</a>
12
- </p>
13
-
14
- # Contents
15
- <ol>
16
- <li><a href="#about">About</a></li>
17
- <li><a href="#installation">Installation</a></li>
18
- <li><a href="#documentation">Documentation</a></li>
19
- <li><a href="#getting-started">Getting Started</a></li>
20
- <li><a href="#contributing">Contributing</a></li>
21
- <li><a href="#acknowledgments">Acknowledgments</a></li>
22
- <li><a href="#contact">Contact</a></li>
23
- </ol>
24
-
25
- # About
26
- 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://www.github.com/Zushah/Chalkboard/releases/tag/v1.0.0) on November 6, 2023. As per the latest release of [v2.3.0 Boole](https://www.github.com/Zushah/Chalkboard/releases/tag/v2.3.0), Chalkboard has 605 unique 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).
27
-
28
- # Installation
29
- If your JavaScript project is being run on the client-side within a webpage, you can install Chalkboard with this HTML tag:
30
- ```html
31
- <script src="https://cdn.jsdelivr.net/gh/Zushah/Chalkboard@2.3.0/dist/Chalkboard.min.js"></script>
32
- ```
33
- 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:
10
+ </p><br>
11
+
12
+ Chalkboard is a library at the intersection of pure mathematics and web engineering.
13
+
14
+ It facilitates the construction and manipulation of computational structures and analytical systems in TypeScript, such as:
15
+ - defining isomorphisms between algebraic structures,
16
+ - computing the flux of vector fields over parameterized surfaces,
17
+ - simulating systems of differential equations,
18
+ - visualizing statistical regression models,
19
+ - simplifying and evaluating both real- and complex-valued expressions,
20
+ - executing multidimensional matrix operations,
21
+ - automating Karnaugh map minimizations,
22
+ - and hundreds upon hundreds of more functionalities.
23
+
24
+ It is all organized in coherent namespaces rather than isolated utilities, providing an ergonomic API for mathematical abstractions and pedagogical applications in both JavaScript and Node.js environments.
25
+
26
+ Chalkboard is intended to serve as a foundational engine for projects where mathematical structure is primary, not periphery, as it is a framework that prioritizes pure mathematics for projects that prioritize pure mathematics.
27
+
28
+ ## Installation
34
29
  ```bash
35
30
  npm install @zushah/chalkboard
36
31
  ```
37
- Alternatively, you can simply download the [latest release](https://www.github.com/Zushah/Chalkboard/releases/tag/v2.3.0) and put the relevant files in your project's directory.
38
-
39
- Chalkboard can also be downloaded on [Khan Academy](https://www.khanacademy.org) from the code in the corresponding [release](https://www.khanacademy.org/cs/chalkboard/6708642430369792).
40
-
41
- # Documentation
42
- Chalkboard has fourteen categories of commands:
43
- - `abal` - Abstract algebra definitions, sets, operations, structures, and morphisms
44
- - `bool` - Boolean algebra operations
45
- - `calc` - Single/multi-variable real/complex-valued calculus operations
46
- - `comp` - Complex number and complex function operations
47
- - `geom` - Geometric operations
48
- - `matr` - Multidimensional matrix operations
49
- - `numb` - Number-theoretic operations
50
- - `plot` - Plotting real and complex functions, complex numbers, vectors, matrices, and statistical graphs
51
- - `quat` - Quaternion operations
52
- - `real` - Real number and real function operations
53
- - `stat` - Statistical array operations
54
- - `tens` - Tensor (multidimensional multidimensional matrix) operations
55
- - `trig` - Trigonometric function operations
56
- - `vect` - Two-, three-, and four-dimensional vector and vector field operations
57
-
58
- There are also nine "global" commands and constants, which are:
32
+ or
33
+ ```html
34
+ <script src="https://cdn.jsdelivr.net/gh/Zushah/Chalkboard@3.0.0/dist/Chalkboard.min.js"></script>
35
+ ```
36
+ or download the [latest release](https://www.github.com/Zushah/Chalkboard/releases/tag/v3.0.0).
37
+
38
+ ## Documentation
39
+
40
+ The comprehensive Chalkboard documentation can be found [here](https://zushah.github.io/Chalkboard).
41
+
42
+ Chalkboard has almost 700 functions across fifteen namespaces:
43
+ - `abal` - Abstract algebra definitions, sets, structures, morphisms, and functions
44
+ - `bool` - Boolean algebra functions and parser
45
+ - `calc` - Single/multi-variable real/complex-valued calculus functions
46
+ - `comp` - Complex-valued functions and parser
47
+ - `diff` - Ordinary differential equations models, solvers, and functions
48
+ - `geom` - Geometric functions
49
+ - `matr` - Multidimensional matrix functions
50
+ - `numb` - Number theory functions
51
+ - `plot` - Plotting real/complex functions, differential equations, complex numbers, vectors, matrices, and statistical graphs
52
+ - `quat` - Quaternion functions
53
+ - `real` - Real-valued functions and parser
54
+ - `stat` - Statistical functions
55
+ - `tens` - Tensor functions
56
+ - `trig` - Trigonometric function functions
57
+ - `vect` - Two-, three-, and four-dimensional vector and vector field functions
58
+
59
+ There are also nine "global" functions, which are:
59
60
  - `APPLY` - Applies a callback function in an element-wise manner on a Chalkboard object
60
61
  - `CONTEXT` - The JavaScript canvas rendering context to use for plotting
61
- - `E()` - Computes the number e
62
- - `I()` - Computes the number i
63
- - `LOGO()` - Draws the Chalkboard logo
64
- - `PARSEPREFIX` - Used for adding custom functions to the Chalkboard parser
65
- - `PI()` - Computes the number π
66
- - `README()` - Prints basic information about Chalkboard in the console
62
+ - `E` - Computes the number e
63
+ - `I` - Computes the number i
64
+ - `PI` - Computes the number π
65
+ - `REGISTER` - Add custom functions to Chalkboard's real/complex-valued parsers
66
+ - `REGISTRY` - Stores custom functions for Chalkboard's real/complex-valued parsers
67
67
  - `VERSION` - The installed version of Chalkboard
68
68
  - `VERSIONALIAS` - The alias of the installed version of Chalkboard
69
69
 
@@ -72,46 +72,74 @@ Lastly, Chalkboard has eleven data types (also known as Chalkboard objects):
72
72
  - `ChalkboardFunction` - Mathematical functions
73
73
  - `ChalkboardMatrix` - Matrices
74
74
  - `ChalkboardMorphism` - Morphisms
75
+ - `ChalkboardODE` - Ordinary differential equations
75
76
  - `ChalkboardQuaternion` - Quaternions
76
77
  - `ChalkboardSet` - Sets
77
78
  - `ChalkboardStructure` - Algebraic structures
78
79
  - `ChalkboardStructureExtension` - Algebraic structure extensions
79
80
  - `ChalkboardTensor` - Tensors
80
81
  - `ChalkboardVector` - Vectors
81
- - `ChalkboardVectorField` - Vector fields
82
82
 
83
- The comprehensive Chalkboard documentation can be visited [here](https://zushah.github.io/Chalkboard).
84
-
85
- # Getting Started
86
- After installing Chalkboard into your program, you can immediately get started with using it. Every Chalkboard command begins with typing "Chalkboard" followed by a period, then the name of the category of the command (all categories are listed above in the [documentation](#documentation) section) with another period, and lastly the desired command itself.
83
+ ## Getting Started
84
+ After installing Chalkboard, you can straightforwardly get started with it, since every function begins with `Chalkboard` followed by a period, then a `namespace` (all fifteen namespaces are listed [above](#documentation)) followed by another period, and lastly the `function` itself.
87
85
  ```js
88
- Chalkboard.category.command(parameters);
86
+ Chalkboard.namespace.function(parameters);
89
87
  ```
90
- Here is some code that shows off only a few features of Chalkboard:
88
+ Ten interesting examples of Chalkboard can be found [here](https://zushah.github.io/Chalkboard/examples/index.html) and their source code can be found [here](https://www.github.com/Zushah/Chalkboard/tree/main/examples).
89
+
90
+ Here are snippets of code that show off only a few features of Chalkboard:
91
91
  ```js
92
92
  const cb = Chalkboard; // Initialize in a browser
93
93
  const cb = require("@zushah/chalkboard"); // Initialize in Node with CommonJS
94
- import cb from "@zushah/chalkboard"; // Initiialize in Node with ES Modules
94
+ import cb from "@zushah/chalkboard"; // Initialize in Node with ES Modules
95
95
 
96
- const f = cb.real.define("Math.cos(2 * x)"); // f(x) = cos(2x)
96
+ const Z4 = cb.abal.Z(4); // The set of integers modulo 4 is the set {0, 1, 2, 3}
97
+ const C4 = cb.abal.C(4); // The set of fourth roots of unity is the set {1, i, -1, -i}
98
+ const G = cb.abal.group(Z4, (a, b) => (a + b) % 4); // The group G is the set Z₄ with mod 4 addition
99
+ const H = cb.abal.group(C4, (z, w) => cb.comp.mul(z, w)); // The group H is the set C₄ with complex multiplication
100
+ const F = cb.abal.isomorphism(G, H, (n) => cb.I(n)); // The isomorphism F: G → H is defined by F(n) = iⁿ for all n in Z₄
101
+ const Fi = cb.abal.invmorphism(F); // The isomorphism F⁻¹: H → G is defined by F⁻¹(z) = (2/π)·arg(z) mod 4 for all z in C₄
102
+ const S = cb.abal.set([0, 2]); // The set {0, 2} is a subset of Z₄
103
+ const K = cb.abal.group(S, (a, b) => (a + b) % 4, 0, (n) => (4 - n) % 4); // The subgroup K is the set S with mod 4 addition
104
+ const Q = cb.abal.quotient(G, K); // The quotient group Q = G/K is the set of cosets {{0, 2}, {1, 3}} with an operation inherited from G
105
+
106
+ const expr0 = cb.real.parse("x^2 + 1", { values: { x: 2 } }); // Returns 5
107
+ const expr1 = cb.real.parse("(2x + 3y)^4"); // Returns 16x^4 + 81y^4 + 96x^3y + 216x^2y^2 + 216y^3x
108
+ const expr2 = cb.real.parse("(1 + exp(2))(3 + sin(4x))"); // Returns 25.1672 + 8.3891sin(4x)
109
+ const expr3 = cb.comp.parse("exp(z)(w + 1)", { returnLaTeX: true }); // Returns w\mathrm{exp}\left(z\right) + \mathrm{exp}\left(z\right)
110
+ const expr4 = cb.comp.parse("(1 + exp(2i))(3 + sin(4i))"); // Returns -23.0631 + 18.6612i
111
+ const expr5 = cb.comp.parse("(2x + 3y)^4"); // Returns 16x^4 + 81y^4 + 96x^3y + 216x^2y^2 + 216y^3x
112
+ const expr6 = cb.comp.parse("z^2 + 1", { values: { z: Chalkboard.comp.init(1, 2) } }); // Returns -2 + 4i
113
+ const expr7 = cb.bool.parse("x & !x | y & x | y & !x"); // Returns y
114
+ const expr8 = cb.bool.parse("x & y | z", { values: { x: true, y: false, z: true } }); // Returns true
115
+ const expr9 = cb.bool.parse("x & y", { returnAST: true }); // Returns {"type":"and","left":{"type":"var","name":"x"},"right":{"type":"var","name":"y"}}
116
+
117
+ const f = cb.real.define((x) => cb.trig.cos(2*x)); // f(x) = cos(2x)
97
118
  const dfdx = cb.calc.dfdx(f, 2); // Derivative of f at x = 0
98
119
  const fxdx = cb.calc.fxdx(f, 0, 2); // Antiderivative of f from x = 0 to x = 2
99
- const fourier = cb.calc.Fourier(f, 2); // Fourier transform of f at x = 2
120
+ const F = cb.calc.Fourier(f, 2); // Fourier transform of f at x = 2
100
121
 
101
- const f = cb.vect.field("x", "y", "z"); // f(x, y, z) = (x, y, z)
102
- const r = cb.real.define(["Math.cos(s) * Math.cos(t)", "Math.sin(s) * Math.cos(t)", "Math.sin(t)"], "surf"); // r(s, t) = (cos(s)cos(t), sin(s)cos(t), sin(t))
122
+ const f = cb.real.define((x, y, z) => x, (x, y, z) => y, (x, y, z) => z); // f(x, y, z) = (x, y, z)
123
+ const r = cb.real.define((s, t) => cb.trig.cos(s) * cb.trig.cos(t), (s, t) => cb.trig.sin(s) * cb.trig.cos(t), (s, t) => cb.trig.sin(t)); // r(s, t) = (cos(s)cos(t), sin(s)cos(t), sin(t))
103
124
  const fnds = cb.calc.fnds(f, r, cb.PI(-1/2), cb.PI(1/2), 0, cb.PI(2)); // Flux of the radial vector field through the unit sphere
104
125
 
126
+ const f = cb.diff.harmonic(cb.PI(2)); // Defines harmonic oscillator y'' = -4π²y
127
+ const sol = cb.diff.solveAdaptive(f, { t0: 0, t1: 2, y0: { y0: 1, dy0: 0 }, h0: 0.01, hMin: 1e-6, hMax: 0.05 }); // Solves with adaptive Dormand–Prince RK45
128
+ const samples = cb.diff.sample(sol, [0, 0.25, 0.5, 0.75, 1.0]); // Samples solution at specified times
129
+ const phase = cb.diff.phase(sol, 0, 1); // Produces (y, dy) pairs for a phase plot
130
+ const err = cb.diff.error(sol, f, "LInfinity"); // Computes residual error (infinity norm) of the solution
131
+ cb.plot.ode(sol, { phase: true, i: 0, j: 1 }); // Plots the phase portrait (y vs dy) on the canvas
132
+
105
133
  const primes = cb.numb.primeArr(0, 100); // Array of prime numbers between 0 and 100
106
134
  const midPrime = cb.stat.median(primes); // Median number in the primes array
107
135
  cb.plot.barplot(primes, cb.stat.array(0, 100, 11), {size: 5, strokeStyle: "black", fillStyle: "blue"}); // 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
108
136
 
109
137
  const z = cb.comp.init(1, 1); // z = 1 + i
110
138
  const zsqsqrt = cb.comp.sqrt(cb.comp.sq(z)); // The square root of z squared equals z
111
- const f = cb.comp.define("a*a - b*b + 1", "2*a*b"); // f(z) = z^2 + 1
139
+ const f = cb.comp.define((z) => cb.comp.add(cb.comp.sq(z), 1)); // f(z) = z^2 + 1
112
140
  cb.plot.definition(f); // Plots the domain coloring of f
113
141
 
114
- const r = cb.real.define(["Math.cos(t)", "Math.sin(t)"], "curv"); // r(t) = (cos(t), sin(t))
142
+ const r = cb.real.define((t) => cb.trig.cos(t), (t) => cb.trig.sin(t)); // r(t) = (cos(t), sin(t))
115
143
  cb.plot.xyplane({size: 2}); // Draws the Cartesian coordinate plane scaled by 2
116
144
  cb.plot.definition(r, {size: 2, strokeStyle: "rgb(255, 100, 100)", domain: [0, cb.PI(2)]}); // Plots r(t) scaled by 2 colored light red from t = 0 to t = π/2
117
145
 
@@ -147,33 +175,22 @@ const ttm = cb.tens.resize(tt, 8, 8); // ttm is an 8x8 matrix (or rank-2 tensor)
147
175
  cb.tens.print(tt); // Prints tt in the console just to see what it looks like for fun
148
176
  const factorialt = cb.APPLY(t, (x) => cb.numb.factorial(x)); // Calculates the factorial of each element of t
149
177
 
150
- const Z4 = cb.abal.Z(4); // The set of integers modulo 4 is the set {0, 1, 2, 3}
151
- const C4 = cb.abal.C(4); // The set of fourth roots of unity is the set {1, i, -1, -i}
152
- const G = cb.abal.group(Z4, (a, b) => (a + b) % 4); // The group G is the set Z₄ with mod 4 addition
153
- const H = cb.abal.group(C4, (z, w) => cb.comp.mul(z, w)); // The group H is the set C₄ with complex multiplication
154
- const F = cb.abal.isomorphism(G, H, (n) => cb.comp.round(cb.comp.pow(cb.comp.init(0, 1), n))); // The isomorphism F: G → H is defined by F(n) = iⁿ for all n in Z₄
178
+ const m = cb.numb.convert(1500, "mm", "m"); // Length conversion
179
+ const sqmi = cb.numb.convert(1000000, "m2", "mi2"); // Area conversion
180
+ const kg = cb.numb.convert(5000, "g", "kg"); // Mass conversion
181
+ const ml = cb.numb.convert(3, "gal", "mL"); // Volume conversion
182
+ const pa = cb.numb.convert(1, "atm", "Pa"); // Pressure conversion
183
+ const ns = cb.numb.convert(2, "hr", "ns"); // Time conversion
184
+ const k = cb.numb.convert(98.6, "F", "K"); // Temperature conversion
155
185
  ```
156
- Several examples that are rather interesting can be seen [here](https://zushah.github.io/Chalkboard/examples/index.html), and their source code is [here](https://www.github.com/Zushah/Chalkboard/tree/main/examples).
157
-
158
- # Contributing
159
- <ol>
160
- <li>Fork Chalkboard's GitHub repository. Make sure the fork is based on the main branch.</li>
161
- <li>Clone the repository, download the dev dependencies with `npm install`, and then make your contributions to your fork.</li>
162
- <li>When you're done, commit the changes to your fork with a detailed description.</li>
163
- <li>Open a pull request. It will be reviewed soon and then merged to the main branch.</li>
164
- </ol>
165
-
166
- NOTE: If you want to change the documentation, you will also have to clone the [zushah.github.io repository](https://www.github.com/Zushah/zushah.github.io) because that's where the files are generated.
167
-
168
- The changelog can be read [here](https://www.github.com/Zushah/Chalkboard/blob/main/CHANGELOG.md).
169
186
 
170
- The Chalkboard library is available under the [MIT License](https://www.github.com/Zushah/Chalkboard/blob/main/LICENSE.md).
187
+ ## Contributing
188
+ Contributions to Chalkboard are welcome! The contribution guidelines can be found [here](https://www.github.com/Zushah/Chalkboard/blob/main/CONTRIBUTING.md). Also, the changelog can be found [here](https://www.github.com/Zushah/Chalkboard/blob/main/CHANGELOG.md).
171
189
 
172
- # Acknowledgments
173
- Thanks to [@bhavjitChauhan](https://www.github.com/bhavjitChauhan) for his contribution ([here](https://www.github.com/Zushah/Chalkboard/pull/1)) to [v1.3.0 Heaviside](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.3.0).\
174
- Thanks to [@gyang0](https://www.github.com/gyang0) for his contributions ([here](https://www.github.com/Zushah/zushah.github.io/pull/1) and [here](https://github.com/Zushah/Chalkboard/pull/5)) to the [documentation](https://www.github.com/Zushah/zushah.github.io/tree/main/Chalkboard).\
175
- Thanks to [@JentGent](https://www.github.com/JentGent) for his implementation ([here](https://www.github.com/JentGent/linalg/blob/main/linalg.js#L519)) for calculating QR decomposition which was [adapted](https://www.github.com/Zushah/Chalkboard/commit/1dce0dbac82b38f9a550dd496bc878c402a92442) into [v1.7.0 Descartes](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.7.0).
190
+ ## Acknowledgments
191
+ Thanks to [@bhavjitChauhan](https://www.github.com/bhavjitChauhan) for his contribution ([`d3f0a82`](https://github.com/Zushah/Chalkboard/commit/d3f0a82f0c2b1351f391908ef2d6f78403881259)) to [v1.3.0 Heaviside](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.3.0).\
192
+ Thanks to [@gyang0](https://www.github.com/gyang0) for his contributions ([`00a7428`](https://github.com/Zushah/zushah.github.io/commit/00a7428bf7036fd169545b16c1845ce0ddcf0f56), [`90c9564`](https://github.com/Zushah/Chalkboard/commit/90c9564d0e12a7de1795dc034d2f9260c0336f30)) to the [documentation](https://www.github.com/Zushah/zushah.github.io/tree/main/Chalkboard).\
193
+ Thanks to [@JentGent](https://www.github.com/JentGent) for his [implementation](https://www.github.com/JentGent/linalg/blob/main/linalg.js#L519) for calculating QR decomposition which was adapted ([`1dce0db`](https://www.github.com/Zushah/Chalkboard/commit/1dce0dbac82b38f9a550dd496bc878c402a92442)) into [v1.7.0 Descartes](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.7.0).
176
194
 
177
- # Contact
178
- [GitHub](https://www.github.com/Zushah)\
179
- [Khan Academy](https://www.khanacademy.org/profile/zushah77)
195
+ ## License
196
+ Chalkboard is available under the [Mozilla Public License 2.0](https://www.github.com/Zushah/Chalkboard/blob/main/LICENSE.md).