mathjs 7.3.0 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. package/HISTORY.md +29 -0
  2. package/dist/math.js +2716 -2222
  3. package/dist/math.min.js +5 -5
  4. package/dist/math.min.map +1 -1
  5. package/docs/datatypes/units.md +21 -0
  6. package/docs/reference/functions/ceil.md +10 -1
  7. package/docs/reference/functions/fix.md +10 -2
  8. package/docs/reference/functions/floor.md +12 -3
  9. package/docs/reference/functions/rotate.md +47 -0
  10. package/docs/reference/functions/rotationMatrix.md +51 -0
  11. package/docs/reference/functions/round.md +6 -2
  12. package/docs/reference/functions.md +2 -0
  13. package/es/entry/dependenciesAny/dependenciesCeil.generated.js +4 -0
  14. package/es/entry/dependenciesAny/dependenciesFix.generated.js +2 -0
  15. package/es/entry/dependenciesAny/dependenciesFloor.generated.js +4 -0
  16. package/es/entry/dependenciesAny/dependenciesRotate.generated.js +14 -0
  17. package/es/entry/dependenciesAny/dependenciesRotationMatrix.generated.js +30 -0
  18. package/es/entry/dependenciesAny.generated.js +2 -0
  19. package/es/entry/impureFunctionsAny.generated.js +55 -53
  20. package/es/entry/pureFunctionsAny.generated.js +230 -206
  21. package/es/expression/embeddedDocs/embeddedDocs.js +4 -0
  22. package/es/expression/embeddedDocs/function/matrix/rotate.js +8 -0
  23. package/es/expression/embeddedDocs/function/matrix/rotationMatrix.js +8 -0
  24. package/es/expression/node/FunctionNode.js +1 -1
  25. package/es/expression/node/Node.js +2 -2
  26. package/es/factoriesAny.js +2 -0
  27. package/es/function/arithmetic/ceil.js +88 -4
  28. package/es/function/arithmetic/fix.js +43 -6
  29. package/es/function/arithmetic/floor.js +90 -6
  30. package/es/function/arithmetic/round.js +6 -2
  31. package/es/function/matrix/rotate.js +78 -0
  32. package/es/function/matrix/rotationMatrix.js +176 -0
  33. package/es/function/matrix/sqrtm.js +4 -0
  34. package/es/function/probability/pickRandom.js +2 -6
  35. package/es/function/special/erf.js +1 -0
  36. package/es/plain/number/constants.js +1 -1
  37. package/es/plain/number/probability.js +1 -0
  38. package/es/type/unit/Unit.js +17 -18
  39. package/es/utils/object.js +3 -1
  40. package/es/version.js +1 -1
  41. package/examples/bignumbers.js +2 -0
  42. package/lib/entry/dependenciesAny/dependenciesCeil.generated.js +6 -0
  43. package/lib/entry/dependenciesAny/dependenciesFix.generated.js +3 -0
  44. package/lib/entry/dependenciesAny/dependenciesFloor.generated.js +6 -0
  45. package/lib/entry/dependenciesAny/dependenciesRotate.generated.js +26 -0
  46. package/lib/entry/dependenciesAny/dependenciesRotationMatrix.generated.js +50 -0
  47. package/lib/entry/dependenciesAny.generated.js +16 -0
  48. package/lib/entry/impureFunctionsAny.generated.js +58 -56
  49. package/lib/entry/mainAny.js +5 -0
  50. package/lib/entry/mainNumber.js +5 -0
  51. package/lib/entry/pureFunctionsAny.generated.js +270 -244
  52. package/lib/expression/embeddedDocs/embeddedDocs.js +6 -0
  53. package/lib/expression/embeddedDocs/function/matrix/rotate.js +15 -0
  54. package/lib/expression/embeddedDocs/function/matrix/rotationMatrix.js +15 -0
  55. package/lib/expression/node/FunctionNode.js +1 -1
  56. package/lib/expression/node/Node.js +2 -2
  57. package/lib/factoriesAny.js +16 -0
  58. package/lib/function/arithmetic/ceil.js +91 -4
  59. package/lib/function/arithmetic/fix.js +44 -6
  60. package/lib/function/arithmetic/floor.js +93 -6
  61. package/lib/function/arithmetic/round.js +6 -2
  62. package/lib/function/matrix/rotate.js +88 -0
  63. package/lib/function/matrix/rotationMatrix.js +186 -0
  64. package/lib/function/matrix/sqrtm.js +4 -0
  65. package/lib/function/probability/pickRandom.js +3 -7
  66. package/lib/function/special/erf.js +1 -0
  67. package/lib/header.js +2 -2
  68. package/lib/plain/bignumber/index.js +1 -0
  69. package/lib/plain/number/constants.js +2 -1
  70. package/lib/plain/number/index.js +9 -0
  71. package/lib/plain/number/probability.js +1 -0
  72. package/lib/type/unit/Unit.js +17 -18
  73. package/lib/utils/object.js +3 -1
  74. package/lib/version.js +1 -1
  75. package/package.json +11 -11
  76. package/src/core/function/import.js +2 -2
  77. package/src/entry/dependenciesAny/dependenciesCeil.generated.js +4 -0
  78. package/src/entry/dependenciesAny/dependenciesFix.generated.js +2 -0
  79. package/src/entry/dependenciesAny/dependenciesFloor.generated.js +4 -0
  80. package/src/entry/dependenciesAny/dependenciesRotate.generated.js +15 -0
  81. package/src/entry/dependenciesAny/dependenciesRotationMatrix.generated.js +31 -0
  82. package/src/entry/dependenciesAny.generated.js +2 -0
  83. package/src/entry/impureFunctionsAny.generated.js +84 -80
  84. package/src/entry/pureFunctionsAny.generated.js +75 -71
  85. package/src/expression/embeddedDocs/embeddedDocs.js +4 -0
  86. package/src/expression/embeddedDocs/function/matrix/rotate.js +19 -0
  87. package/src/expression/embeddedDocs/function/matrix/rotationMatrix.js +19 -0
  88. package/src/expression/node/FunctionNode.js +1 -1
  89. package/src/expression/node/Node.js +2 -1
  90. package/src/factoriesAny.js +2 -0
  91. package/src/function/arithmetic/ceil.js +63 -3
  92. package/src/function/arithmetic/fix.js +45 -6
  93. package/src/function/arithmetic/floor.js +65 -5
  94. package/src/function/arithmetic/round.js +6 -2
  95. package/src/function/matrix/rotate.js +79 -0
  96. package/src/function/matrix/rotationMatrix.js +186 -0
  97. package/src/function/matrix/sqrtm.js +4 -0
  98. package/src/function/probability/pickRandom.js +2 -6
  99. package/src/function/special/erf.js +2 -0
  100. package/src/plain/number/constants.js +1 -1
  101. package/src/plain/number/probability.js +2 -0
  102. package/src/type/unit/Unit.js +18 -21
  103. package/src/utils/object.js +3 -1
  104. package/src/version.js +1 -1
@@ -26,13 +26,13 @@ import {
26
26
  createParse,
27
27
  createEvaluate,
28
28
  createHelpClass,
29
+ createParserClass,
30
+ createHelp,
31
+ createCompile,
29
32
  createSimplify,
30
33
  createRationalize,
31
- createCompile,
32
- createHelp,
33
- createParserClass,
34
- createDerivative,
35
34
  createParser,
35
+ createDerivative,
36
36
  createApplyTransform,
37
37
  createFilterTransform,
38
38
  createMapTransform,
@@ -234,44 +234,49 @@ import {
234
234
  subtract,
235
235
  cross,
236
236
  range,
237
+ row,
238
+ prod,
239
+ equal,
240
+ max,
241
+ setCartesian,
242
+ setSymDifference,
243
+ fix,
244
+ column,
237
245
  ctranspose,
246
+ deepEqual,
247
+ setIsSubset,
248
+ xor,
238
249
  divideScalar,
239
250
  nthRoots,
240
251
  lsolve,
241
252
  lsolveAll,
242
- equal,
243
- max,
244
- setCartesian,
245
- setSymDifference,
246
- hypot,
247
- qr,
253
+ Spa,
254
+ setUnion,
255
+ lup,
256
+ slu,
257
+ det,
248
258
  distance,
249
259
  stirlingS2,
250
260
  catalan,
251
- fix,
252
- column,
253
- row,
261
+ diff,
254
262
  log,
255
263
  dotDivide,
256
264
  usolveAll,
257
- Spa,
258
- setIsSubset,
259
- lup,
260
- det,
261
- intersect,
262
- bellNumbers,
263
- xor,
264
- prod,
265
- usolve,
266
- Unit,
267
- createUnit,
268
- slu,
265
+ hypot,
266
+ qr,
269
267
  inv,
270
268
  expm,
271
269
  divide,
272
- median,
270
+ mean,
273
271
  variance,
274
272
  kldivergence,
273
+ bellNumbers,
274
+ log1p,
275
+ Unit,
276
+ createUnit,
277
+ eigs,
278
+ intersect,
279
+ std,
275
280
  atomicMass,
276
281
  bohrMagneton,
277
282
  boltzmann,
@@ -295,13 +300,11 @@ import {
295
300
  secondRadiation,
296
301
  stefanBoltzmann,
297
302
  vacuumImpedance,
298
- diff,
299
- deepEqual,
300
- setUnion,
303
+ usolve,
304
+ norm,
301
305
  lusolve,
302
- eigs,
303
- mean,
304
- std,
306
+ sqrtm,
307
+ multinomial,
305
308
  avogadro,
306
309
  classicalElectronRadius,
307
310
  electricConstant,
@@ -314,23 +317,22 @@ import {
314
317
  quantumOfCirculation,
315
318
  speedOfLight,
316
319
  wienDisplacement,
317
- log1p,
318
- norm,
319
- sqrtm,
320
- multinomial,
320
+ rotationMatrix,
321
+ median,
321
322
  bohrRadius,
322
323
  elementaryCharge,
323
324
  inverseConductanceQuantum,
324
325
  molarVolume,
325
326
  planckTime,
326
327
  thomsonCrossSection,
327
- unit,
328
+ rotate,
328
329
  mad,
329
330
  coulomb,
330
331
  magneticFluxQuantum,
331
332
  rydberg,
332
- planckConstant,
333
- gasConstant
333
+ unit,
334
+ gasConstant,
335
+ planckConstant
334
336
  } from './pureFunctionsAny.generated'
335
337
 
336
338
  const math = {} // NOT pure!
@@ -359,13 +361,13 @@ export const FunctionNode = createFunctionNode({ Node, SymbolNode, math })
359
361
  export const parse = createParse({ AccessorNode, ArrayNode, AssignmentNode, BlockNode, ConditionalNode, ConstantNode, FunctionAssignmentNode, FunctionNode, IndexNode, ObjectNode, OperatorNode, ParenthesisNode, RangeNode, RelationalNode, SymbolNode, config, numeric, typed })
360
362
  export const evaluate = createEvaluate({ parse, typed })
361
363
  export const Help = createHelpClass({ parse })
364
+ export const Parser = createParserClass({ parse })
365
+ export const help = createHelp({ Help, mathWithTransform, typed })
366
+ export const compile = createCompile({ parse, typed })
362
367
  export const simplify = createSimplify({ bignumber, fraction, ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, add, config, divide, equal, isZero, mathWithTransform, multiply, parse, pow, subtract, typed })
363
368
  export const rationalize = createRationalize({ bignumber, fraction, ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, add, config, divide, equal, isZero, mathWithTransform, multiply, parse, pow, simplify, subtract, typed })
364
- export const compile = createCompile({ parse, typed })
365
- export const help = createHelp({ Help, mathWithTransform, typed })
366
- export const Parser = createParserClass({ parse })
367
- export const derivative = createDerivative({ ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, config, equal, isZero, numeric, parse, simplify, typed })
368
369
  export const parser = createParser({ Parser, typed })
370
+ export const derivative = createDerivative({ ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, config, equal, isZero, numeric, parse, simplify, typed })
369
371
 
370
372
  Object.assign(math, {
371
373
  reviver,
@@ -543,42 +545,47 @@ Object.assign(math, {
543
545
  subtract,
544
546
  cross,
545
547
  range,
548
+ row,
549
+ prod,
550
+ equal,
551
+ max,
552
+ setCartesian,
553
+ setSymDifference,
554
+ fix,
555
+ column,
546
556
  ctranspose,
557
+ deepEqual,
558
+ setIsSubset,
559
+ xor,
547
560
  divideScalar,
548
561
  nthRoots,
549
562
  lsolve,
550
563
  lsolveAll,
551
- equal,
552
- max,
553
- setCartesian,
554
- setSymDifference,
555
- hypot,
556
- qr,
564
+ setUnion,
565
+ lup,
566
+ slu,
567
+ det,
557
568
  distance,
558
569
  stirlingS2,
559
570
  catalan,
560
- fix,
561
- column,
562
- row,
571
+ diff,
563
572
  log,
564
573
  dotDivide,
565
574
  usolveAll,
566
- setIsSubset,
567
- lup,
568
- det,
569
- intersect,
570
- bellNumbers,
571
- xor,
572
- prod,
573
- usolve,
574
- createUnit,
575
- slu,
575
+ hypot,
576
+ qr,
576
577
  inv,
577
578
  expm,
578
579
  divide,
579
- median,
580
+ mean,
580
581
  variance,
581
582
  kldivergence,
583
+ bellNumbers,
584
+ log1p,
585
+ createUnit,
586
+ eigs,
587
+ intersect,
588
+ std,
582
589
  atomicMass,
583
590
  bohrMagneton,
584
591
  boltzmann,
@@ -602,13 +609,11 @@ Object.assign(math, {
602
609
  secondRadiation,
603
610
  stefanBoltzmann,
604
611
  vacuumImpedance,
605
- diff,
606
- deepEqual,
607
- setUnion,
612
+ usolve,
613
+ norm,
608
614
  lusolve,
609
- eigs,
610
- mean,
611
- std,
615
+ sqrtm,
616
+ multinomial,
612
617
  avogadro,
613
618
  classicalElectronRadius,
614
619
  electricConstant,
@@ -621,31 +626,30 @@ Object.assign(math, {
621
626
  quantumOfCirculation,
622
627
  speedOfLight,
623
628
  wienDisplacement,
624
- log1p,
625
- norm,
626
- sqrtm,
627
- multinomial,
629
+ rotationMatrix,
630
+ median,
628
631
  bohrRadius,
629
632
  elementaryCharge,
630
633
  inverseConductanceQuantum,
631
634
  molarVolume,
632
635
  planckTime,
633
636
  thomsonCrossSection,
634
- unit,
637
+ rotate,
638
+ parse,
639
+ evaluate,
635
640
  mad,
636
641
  coulomb,
637
642
  magneticFluxQuantum,
638
643
  rydberg,
639
- parse,
640
- evaluate,
644
+ unit,
645
+ help,
646
+ gasConstant,
647
+ compile,
641
648
  simplify,
642
649
  rationalize,
650
+ parser,
643
651
  planckConstant,
644
- compile,
645
- help,
646
- gasConstant,
647
652
  derivative,
648
- parser,
649
653
  config
650
654
  })
651
655
 
@@ -186,44 +186,49 @@ import {
186
186
  createSubtract,
187
187
  createCross,
188
188
  createRange,
189
+ createRow,
190
+ createProd,
191
+ createEqual,
192
+ createMax,
193
+ createSetCartesian,
194
+ createSetSymDifference,
195
+ createFix,
196
+ createColumn,
189
197
  createCtranspose,
198
+ createDeepEqual,
199
+ createSetIsSubset,
200
+ createXor,
190
201
  createDivideScalar,
191
202
  createNthRoots,
192
203
  createLsolve,
193
204
  createLsolveAll,
194
- createEqual,
195
- createMax,
196
- createSetCartesian,
197
- createSetSymDifference,
198
- createHypot,
199
- createQr,
205
+ createSpaClass,
206
+ createSetUnion,
207
+ createLup,
208
+ createSlu,
209
+ createDet,
200
210
  createDistance,
201
211
  createStirlingS2,
202
212
  createCatalan,
203
- createFix,
204
- createColumn,
205
- createRow,
213
+ createDiff,
206
214
  createLog,
207
215
  createDotDivide,
208
216
  createUsolveAll,
209
- createSpaClass,
210
- createSetIsSubset,
211
- createLup,
212
- createDet,
213
- createIntersect,
214
- createBellNumbers,
215
- createXor,
216
- createProd,
217
- createUsolve,
218
- createUnitClass,
219
- createCreateUnit,
220
- createSlu,
217
+ createHypot,
218
+ createQr,
221
219
  createInv,
222
220
  createExpm,
223
221
  createDivide,
224
- createMedian,
222
+ createMean,
225
223
  createVariance,
226
224
  createKldivergence,
225
+ createBellNumbers,
226
+ createLog1p,
227
+ createUnitClass,
228
+ createCreateUnit,
229
+ createEigs,
230
+ createIntersect,
231
+ createStd,
227
232
  createAtomicMass,
228
233
  createBohrMagneton,
229
234
  createBoltzmann,
@@ -247,13 +252,11 @@ import {
247
252
  createSecondRadiation,
248
253
  createStefanBoltzmann,
249
254
  createVacuumImpedance,
250
- createDiff,
251
- createDeepEqual,
252
- createSetUnion,
255
+ createUsolve,
256
+ createNorm,
253
257
  createLusolve,
254
- createEigs,
255
- createMean,
256
- createStd,
258
+ createSqrtm,
259
+ createMultinomial,
257
260
  createAvogadro,
258
261
  createClassicalElectronRadius,
259
262
  createElectricConstant,
@@ -266,23 +269,22 @@ import {
266
269
  createQuantumOfCirculation,
267
270
  createSpeedOfLight,
268
271
  createWienDisplacement,
269
- createLog1p,
270
- createNorm,
271
- createSqrtm,
272
- createMultinomial,
272
+ createRotationMatrix,
273
+ createMedian,
273
274
  createBohrRadius,
274
275
  createElementaryCharge,
275
276
  createInverseConductanceQuantum,
276
277
  createMolarVolume,
277
278
  createPlanckTime,
278
279
  createThomsonCrossSection,
279
- createUnitFunction,
280
+ createRotate,
280
281
  createMad,
281
282
  createCoulomb,
282
283
  createMagneticFluxQuantum,
283
284
  createRydberg,
284
- createPlanckConstant,
285
- createGasConstant
285
+ createUnitFunction,
286
+ createGasConstant,
287
+ createPlanckConstant
286
288
  } from '../factoriesAny'
287
289
 
288
290
  export const ResultSet = /* #__PURE__ */ createResultSet({})
@@ -421,7 +423,7 @@ export const dot = /* #__PURE__ */ createDot({ addScalar, conj, multiplyScalar,
421
423
  export const composition = /* #__PURE__ */ createComposition({ addScalar, combinations, isInteger, isNegative, isPositive, larger, typed })
422
424
  export const isZero = /* #__PURE__ */ createIsZero({ typed })
423
425
  export const abs = /* #__PURE__ */ createAbs({ typed })
424
- export const floor = /* #__PURE__ */ createFloor({ config, round, typed })
426
+ export const floor = /* #__PURE__ */ createFloor({ config, equalScalar, matrix, round, typed })
425
427
  export const multiply = /* #__PURE__ */ createMultiply({ addScalar, dot, equalScalar, matrix, multiplyScalar, typed })
426
428
  export const dotMultiply = /* #__PURE__ */ createDotMultiply({ equalScalar, matrix, multiplyScalar, typed })
427
429
  export const re = /* #__PURE__ */ createRe({ typed })
@@ -463,48 +465,53 @@ export const index = /* #__PURE__ */ createIndex({ Index, typed })
463
465
  export const sum = /* #__PURE__ */ createSum({ add, config, numeric, typed })
464
466
  export const factorial = /* #__PURE__ */ createFactorial({ gamma, typed })
465
467
  export const permutations = /* #__PURE__ */ createPermutations({ factorial, typed })
466
- export const ceil = /* #__PURE__ */ createCeil({ config, round, typed })
468
+ export const ceil = /* #__PURE__ */ createCeil({ config, equalScalar, matrix, round, typed })
467
469
  export const subtract = /* #__PURE__ */ createSubtract({ DenseMatrix, addScalar, equalScalar, matrix, typed, unaryMinus })
468
470
  export const cross = /* #__PURE__ */ createCross({ matrix, multiply, subtract, typed })
469
471
  export const range = /* #__PURE__ */ createRange({ bignumber, matrix, config, larger, largerEq, smaller, smallerEq, typed })
472
+ export const row = /* #__PURE__ */ createRow({ Index, matrix, range, typed })
473
+ export const prod = /* #__PURE__ */ createProd({ config, multiplyScalar, numeric, typed })
474
+ export const equal = /* #__PURE__ */ createEqual({ DenseMatrix, equalScalar, matrix, typed })
475
+ export const max = /* #__PURE__ */ createMax({ config, larger, numeric, typed })
476
+ export const setCartesian = /* #__PURE__ */ createSetCartesian({ DenseMatrix, Index, compareNatural, size, subset, typed })
477
+ export const setSymDifference = /* #__PURE__ */ createSetSymDifference({ Index, concat, setDifference, size, subset, typed })
478
+ export const fix = /* #__PURE__ */ createFix({ Complex, ceil, floor, matrix, typed })
479
+ export const column = /* #__PURE__ */ createColumn({ Index, matrix, range, typed })
470
480
  export const ctranspose = /* #__PURE__ */ createCtranspose({ conj, transpose, typed })
481
+ export const deepEqual = /* #__PURE__ */ createDeepEqual({ equal, typed })
482
+ export const setIsSubset = /* #__PURE__ */ createSetIsSubset({ Index, compareNatural, size, subset, typed })
483
+ export const xor = /* #__PURE__ */ createXor({ DenseMatrix, matrix, typed })
471
484
  export const divideScalar = /* #__PURE__ */ createDivideScalar({ numeric, typed })
472
485
  export const nthRoots = /* #__PURE__ */ createNthRoots({ Complex, config, divideScalar, typed })
473
486
  export const lsolve = /* #__PURE__ */ createLsolve({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed })
474
487
  export const lsolveAll = /* #__PURE__ */ createLsolveAll({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed })
475
- export const equal = /* #__PURE__ */ createEqual({ DenseMatrix, equalScalar, matrix, typed })
476
- export const max = /* #__PURE__ */ createMax({ config, larger, numeric, typed })
477
- export const setCartesian = /* #__PURE__ */ createSetCartesian({ DenseMatrix, Index, compareNatural, size, subset, typed })
478
- export const setSymDifference = /* #__PURE__ */ createSetSymDifference({ Index, concat, setDifference, size, subset, typed })
479
- export const hypot = /* #__PURE__ */ createHypot({ abs, addScalar, divideScalar, isPositive, multiplyScalar, smaller, sqrt, typed })
480
- export const qr = /* #__PURE__ */ createQr({ addScalar, complex, conj, divideScalar, equal, identity, isZero, matrix, multiplyScalar, sign, sqrt, subtract, typed, unaryMinus, zeros })
488
+ export const Spa = /* #__PURE__ */ createSpaClass({ FibonacciHeap, addScalar, equalScalar })
489
+ export const setUnion = /* #__PURE__ */ createSetUnion({ Index, concat, setIntersect, setSymDifference, size, subset, typed })
490
+ export const lup = /* #__PURE__ */ createLup({ DenseMatrix, Spa, SparseMatrix, abs, addScalar, divideScalar, equalScalar, larger, matrix, multiplyScalar, subtract, typed, unaryMinus })
491
+ export const slu = /* #__PURE__ */ createSlu({ SparseMatrix, abs, add, divideScalar, larger, largerEq, multiply, subtract, transpose, typed })
492
+ export const det = /* #__PURE__ */ createDet({ lup, matrix, multiply, subtract, typed, unaryMinus })
481
493
  export const distance = /* #__PURE__ */ createDistance({ abs, addScalar, divideScalar, multiplyScalar, sqrt, subtract, typed, unaryMinus })
482
494
  export const stirlingS2 = /* #__PURE__ */ createStirlingS2({ addScalar, combinations, divideScalar, factorial, isInteger, isNegative, larger, multiplyScalar, pow, subtract, typed })
483
495
  export const catalan = /* #__PURE__ */ createCatalan({ addScalar, combinations, divideScalar, isInteger, isNegative, multiplyScalar, typed })
484
- export const fix = /* #__PURE__ */ createFix({ Complex, ceil, floor, typed })
485
- export const column = /* #__PURE__ */ createColumn({ Index, matrix, range, typed })
486
- export const row = /* #__PURE__ */ createRow({ Index, matrix, range, typed })
496
+ export const diff = /* #__PURE__ */ createDiff({ matrix, number, subtract, typed })
487
497
  export const log = /* #__PURE__ */ createLog({ Complex, config, divideScalar, typed })
488
498
  export const dotDivide = /* #__PURE__ */ createDotDivide({ DenseMatrix, divideScalar, equalScalar, matrix, typed })
489
499
  export const usolveAll = /* #__PURE__ */ createUsolveAll({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed })
490
- export const Spa = /* #__PURE__ */ createSpaClass({ FibonacciHeap, addScalar, equalScalar })
491
- export const setIsSubset = /* #__PURE__ */ createSetIsSubset({ Index, compareNatural, size, subset, typed })
492
- export const lup = /* #__PURE__ */ createLup({ DenseMatrix, Spa, SparseMatrix, abs, addScalar, divideScalar, equalScalar, larger, matrix, multiplyScalar, subtract, typed, unaryMinus })
493
- export const det = /* #__PURE__ */ createDet({ lup, matrix, multiply, subtract, typed, unaryMinus })
494
- export const intersect = /* #__PURE__ */ createIntersect({ abs, add, addScalar, config, divideScalar, equalScalar, matrix, multiply, multiplyScalar, smaller, subtract, typed })
495
- export const bellNumbers = /* #__PURE__ */ createBellNumbers({ addScalar, isInteger, isNegative, stirlingS2, typed })
496
- export const xor = /* #__PURE__ */ createXor({ DenseMatrix, matrix, typed })
497
- export const prod = /* #__PURE__ */ createProd({ config, multiplyScalar, numeric, typed })
498
- export const usolve = /* #__PURE__ */ createUsolve({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed })
499
- export const Unit = /* #__PURE__ */ createUnitClass({ BigNumber, Complex, Fraction, abs, addScalar, config, divideScalar, equal, fix, format, isNumeric, multiplyScalar, number, pow, round, subtract })
500
- export const createUnit = /* #__PURE__ */ createCreateUnit({ Unit, typed })
501
- export const slu = /* #__PURE__ */ createSlu({ SparseMatrix, abs, add, divideScalar, larger, largerEq, multiply, subtract, transpose, typed })
500
+ export const hypot = /* #__PURE__ */ createHypot({ abs, addScalar, divideScalar, isPositive, multiplyScalar, smaller, sqrt, typed })
501
+ export const qr = /* #__PURE__ */ createQr({ addScalar, complex, conj, divideScalar, equal, identity, isZero, matrix, multiplyScalar, sign, sqrt, subtract, typed, unaryMinus, zeros })
502
502
  export const inv = /* #__PURE__ */ createInv({ abs, addScalar, det, divideScalar, identity, matrix, multiply, typed, unaryMinus })
503
503
  export const expm = /* #__PURE__ */ createExpm({ abs, add, identity, inv, multiply, typed })
504
504
  export const divide = /* #__PURE__ */ createDivide({ divideScalar, equalScalar, inv, matrix, multiply, typed })
505
- export const median = /* #__PURE__ */ createMedian({ add, compare, divide, partitionSelect, typed })
505
+ export const mean = /* #__PURE__ */ createMean({ add, divide, typed })
506
506
  export const variance = /* #__PURE__ */ createVariance({ add, apply, divide, isNaN, multiply, subtract, typed })
507
507
  export const kldivergence = /* #__PURE__ */ createKldivergence({ divide, dotDivide, isNumeric, log, matrix, multiply, sum, typed })
508
+ export const bellNumbers = /* #__PURE__ */ createBellNumbers({ addScalar, isInteger, isNegative, stirlingS2, typed })
509
+ export const log1p = /* #__PURE__ */ createLog1p({ Complex, config, divideScalar, log, typed })
510
+ export const Unit = /* #__PURE__ */ createUnitClass({ BigNumber, Complex, Fraction, abs, addScalar, config, divideScalar, equal, fix, format, isNumeric, multiplyScalar, number, pow, round, subtract })
511
+ export const createUnit = /* #__PURE__ */ createCreateUnit({ Unit, typed })
512
+ export const eigs = /* #__PURE__ */ createEigs({ abs, add, addScalar, atan, bignumber, config, cos, equal, inv, matrix, multiply, multiplyScalar, sin, subtract, typed })
513
+ export const intersect = /* #__PURE__ */ createIntersect({ abs, add, addScalar, config, divideScalar, equalScalar, matrix, multiply, multiplyScalar, smaller, subtract, typed })
514
+ export const std = /* #__PURE__ */ createStd({ sqrt, typed, variance })
508
515
  export const atomicMass = /* #__PURE__ */ createAtomicMass({ BigNumber, Unit, config })
509
516
  export const bohrMagneton = /* #__PURE__ */ createBohrMagneton({ BigNumber, Unit, config })
510
517
  export const boltzmann = /* #__PURE__ */ createBoltzmann({ BigNumber, Unit, config })
@@ -528,13 +535,11 @@ export const reducedPlanckConstant = /* #__PURE__ */ createReducedPlanckConstant
528
535
  export const secondRadiation = /* #__PURE__ */ createSecondRadiation({ BigNumber, Unit, config })
529
536
  export const stefanBoltzmann = /* #__PURE__ */ createStefanBoltzmann({ BigNumber, Unit, config })
530
537
  export const vacuumImpedance = /* #__PURE__ */ createVacuumImpedance({ BigNumber, Unit, config })
531
- export const diff = /* #__PURE__ */ createDiff({ matrix, number, subtract, typed })
532
- export const deepEqual = /* #__PURE__ */ createDeepEqual({ equal, typed })
533
- export const setUnion = /* #__PURE__ */ createSetUnion({ Index, concat, setIntersect, setSymDifference, size, subset, typed })
538
+ export const usolve = /* #__PURE__ */ createUsolve({ DenseMatrix, divideScalar, equalScalar, matrix, multiplyScalar, subtract, typed })
539
+ export const norm = /* #__PURE__ */ createNorm({ abs, add, conj, ctranspose, eigs, equalScalar, larger, matrix, multiply, pow, smaller, sqrt, typed })
534
540
  export const lusolve = /* #__PURE__ */ createLusolve({ DenseMatrix, lsolve, lup, matrix, slu, typed, usolve })
535
- export const eigs = /* #__PURE__ */ createEigs({ abs, add, addScalar, atan, bignumber, config, cos, equal, inv, matrix, multiply, multiplyScalar, sin, subtract, typed })
536
- export const mean = /* #__PURE__ */ createMean({ add, divide, typed })
537
- export const std = /* #__PURE__ */ createStd({ sqrt, typed, variance })
541
+ export const sqrtm = /* #__PURE__ */ createSqrtm({ abs, add, identity, inv, max, multiply, size, sqrt, subtract, typed })
542
+ export const multinomial = /* #__PURE__ */ createMultinomial({ add, divide, factorial, isInteger, isPositive, multiply, typed })
538
543
  export const avogadro = /* #__PURE__ */ createAvogadro({ BigNumber, Unit, config })
539
544
  export const classicalElectronRadius = /* #__PURE__ */ createClassicalElectronRadius({ BigNumber, Unit, config })
540
545
  export const electricConstant = /* #__PURE__ */ createElectricConstant({ BigNumber, Unit, config })
@@ -547,20 +552,19 @@ export const planckMass = /* #__PURE__ */ createPlanckMass({ BigNumber, Unit, co
547
552
  export const quantumOfCirculation = /* #__PURE__ */ createQuantumOfCirculation({ BigNumber, Unit, config })
548
553
  export const speedOfLight = /* #__PURE__ */ createSpeedOfLight({ BigNumber, Unit, config })
549
554
  export const wienDisplacement = /* #__PURE__ */ createWienDisplacement({ BigNumber, Unit, config })
550
- export const log1p = /* #__PURE__ */ createLog1p({ Complex, config, divideScalar, log, typed })
551
- export const norm = /* #__PURE__ */ createNorm({ abs, add, conj, ctranspose, eigs, equalScalar, larger, matrix, multiply, pow, smaller, sqrt, typed })
552
- export const sqrtm = /* #__PURE__ */ createSqrtm({ abs, add, identity, inv, max, multiply, size, sqrt, subtract, typed })
553
- export const multinomial = /* #__PURE__ */ createMultinomial({ add, divide, factorial, isInteger, isPositive, multiply, typed })
555
+ export const rotationMatrix = /* #__PURE__ */ createRotationMatrix({ BigNumber, DenseMatrix, SparseMatrix, addScalar, config, cos, matrix, multiplyScalar, norm, sin, typed, unaryMinus })
556
+ export const median = /* #__PURE__ */ createMedian({ add, compare, divide, partitionSelect, typed })
554
557
  export const bohrRadius = /* #__PURE__ */ createBohrRadius({ BigNumber, Unit, config })
555
558
  export const elementaryCharge = /* #__PURE__ */ createElementaryCharge({ BigNumber, Unit, config })
556
559
  export const inverseConductanceQuantum = /* #__PURE__ */ createInverseConductanceQuantum({ BigNumber, Unit, config })
557
560
  export const molarVolume = /* #__PURE__ */ createMolarVolume({ BigNumber, Unit, config })
558
561
  export const planckTime = /* #__PURE__ */ createPlanckTime({ BigNumber, Unit, config })
559
562
  export const thomsonCrossSection = /* #__PURE__ */ createThomsonCrossSection({ BigNumber, Unit, config })
560
- export const unit = /* #__PURE__ */ createUnitFunction({ Unit, typed })
563
+ export const rotate = /* #__PURE__ */ createRotate({ multiply, rotationMatrix, typed })
561
564
  export const mad = /* #__PURE__ */ createMad({ abs, map, median, subtract, typed })
562
565
  export const coulomb = /* #__PURE__ */ createCoulomb({ BigNumber, Unit, config })
563
566
  export const magneticFluxQuantum = /* #__PURE__ */ createMagneticFluxQuantum({ BigNumber, Unit, config })
564
567
  export const rydberg = /* #__PURE__ */ createRydberg({ BigNumber, Unit, config })
565
- export const planckConstant = /* #__PURE__ */ createPlanckConstant({ BigNumber, Unit, config })
568
+ export const unit = /* #__PURE__ */ createUnitFunction({ Unit, typed })
566
569
  export const gasConstant = /* #__PURE__ */ createGasConstant({ BigNumber, Unit, config })
570
+ export const planckConstant = /* #__PURE__ */ createPlanckConstant({ BigNumber, Unit, config })
@@ -214,6 +214,8 @@ import { sinDocs } from './function/trigonometry/sin'
214
214
  import { numericDocs } from './function/utils/numeric'
215
215
  import { columnDocs } from './function/matrix/column'
216
216
  import { rowDocs } from './function/matrix/row'
217
+ import { rotationMatrixDocs } from './function/matrix/rotationMatrix'
218
+ import { rotateDocs } from './function/matrix/rotate'
217
219
 
218
220
  export const embeddedDocs = {
219
221
 
@@ -426,6 +428,8 @@ export const embeddedDocs = {
426
428
  range: rangeDocs,
427
429
  resize: resizeDocs,
428
430
  reshape: reshapeDocs,
431
+ rotate: rotateDocs,
432
+ rotationMatrix: rotationMatrixDocs,
429
433
  row: rowDocs,
430
434
  size: sizeDocs,
431
435
  sort: sortDocs,
@@ -0,0 +1,19 @@
1
+ export const rotateDocs = {
2
+ name: 'rotate',
3
+ category: 'Matrix',
4
+ syntax: [
5
+ 'rotate(w, theta)',
6
+ 'rotate(w, theta, v)'
7
+ ],
8
+ description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' +
9
+ 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',
10
+ examples: [
11
+ 'rotate([1, 0], math.pi / 2)',
12
+ 'rotate(matrix([1, 0]), unit("35deg"))',
13
+ 'rotate([1, 0, 0], unit("90deg"), [0, 0, 1])',
14
+ 'rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'
15
+ ],
16
+ seealso: [
17
+ 'matrix', 'rotationMatrix'
18
+ ]
19
+ }
@@ -0,0 +1,19 @@
1
+ export const rotationMatrixDocs = {
2
+ name: 'rotationMatrix',
3
+ category: 'Matrix',
4
+ syntax: [
5
+ 'rotationMatrix(theta)',
6
+ 'rotationMatrix(theta, v)',
7
+ 'rotationMatrix(theta, v, format)'
8
+ ],
9
+ description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' +
10
+ 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',
11
+ examples: [
12
+ 'rotationMatrix(pi / 2)',
13
+ 'rotationMatrix(unit("45deg"), [0, 0, 1])',
14
+ 'rotationMatrix(1, matrix([0, 0, 1]), "sparse")'
15
+ ],
16
+ seealso: [
17
+ 'cos', 'sin'
18
+ ]
19
+ }
@@ -287,7 +287,7 @@ export const createFunctionNode = /* #__PURE__ */ factory(name, dependencies, ({
287
287
 
288
288
  // Match everything of the form ${identifier} or ${identifier[2]} or $$
289
289
  // while submatching identifier and 2 (in the second case)
290
- const regex = new RegExp('\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)', 'ig')
290
+ const regex = /\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi
291
291
 
292
292
  let inputPos = 0 // position in the input string
293
293
  let match
@@ -115,7 +115,8 @@ export const createNode = /* #__PURE__ */ factory(name, dependencies, ({ mathWit
115
115
  */
116
116
  Node.prototype.traverse = function (callback) {
117
117
  // execute callback for itself
118
- callback(this, null, null) // eslint-disable-line standard/no-callback-literal
118
+ // eslint-disable-next-line
119
+ callback(this, null, null)
119
120
 
120
121
  // recursively traverse over all childs of a node
121
122
  function _traverse (node, callback) {
@@ -78,6 +78,8 @@ export { createOnes } from './function/matrix/ones'
78
78
  export { createRange } from './function/matrix/range'
79
79
  export { createReshape } from './function/matrix/reshape'
80
80
  export { createResize } from './function/matrix/resize'
81
+ export { createRotate } from './function/matrix/rotate'
82
+ export { createRotationMatrix } from './function/matrix/rotationMatrix'
81
83
  export { createRow } from './function/matrix/row'
82
84
  export { createSize } from './function/matrix/size'
83
85
  export { createSqueeze } from './function/matrix/squeeze'