mathjs 11.8.1 → 11.9.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.
Files changed (79) hide show
  1. package/HISTORY.md +25 -0
  2. package/lib/browser/math.js +1 -1
  3. package/lib/browser/math.js.LICENSE.txt +2 -2
  4. package/lib/browser/math.js.map +1 -1
  5. package/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js +28 -0
  6. package/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js +4 -0
  7. package/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js +4 -0
  8. package/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js +46 -0
  9. package/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js +26 -0
  10. package/lib/cjs/entry/dependenciesAny.generated.js +21 -0
  11. package/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js +4 -0
  12. package/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js +4 -0
  13. package/lib/cjs/entry/impureFunctionsAny.generated.js +35 -30
  14. package/lib/cjs/entry/impureFunctionsNumber.generated.js +2 -0
  15. package/lib/cjs/entry/pureFunctionsAny.generated.js +82 -45
  16. package/lib/cjs/entry/pureFunctionsNumber.generated.js +2 -0
  17. package/lib/cjs/expression/embeddedDocs/core/typed.js +1 -1
  18. package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +11 -3
  19. package/lib/cjs/expression/embeddedDocs/function/{matrix → algebra}/lyap.js +2 -2
  20. package/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js +1 -1
  21. package/lib/cjs/expression/embeddedDocs/function/{matrix → algebra}/schur.js +2 -2
  22. package/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js +1 -1
  23. package/lib/cjs/expression/embeddedDocs/function/{matrix → algebra}/sylvester.js +2 -2
  24. package/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js +1 -1
  25. package/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js +2 -2
  26. package/lib/cjs/expression/embeddedDocs/function/matrix/diff.js +1 -1
  27. package/lib/cjs/expression/embeddedDocs/function/matrix/range.js +1 -1
  28. package/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js +15 -0
  29. package/lib/cjs/expression/embeddedDocs/function/signal/freqz.js +15 -0
  30. package/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js +15 -0
  31. package/lib/cjs/expression/embeddedDocs/function/utils/numeric.js +1 -1
  32. package/lib/cjs/expression/transform/range.transform.js +7 -3
  33. package/lib/cjs/factoriesAny.js +21 -0
  34. package/lib/cjs/function/algebra/simplify.js +3 -0
  35. package/lib/cjs/function/matrix/range.js +34 -110
  36. package/lib/cjs/function/numeric/solveODE.js +315 -0
  37. package/lib/cjs/function/signal/freqz.js +117 -0
  38. package/lib/cjs/function/signal/zpk2tf.js +95 -0
  39. package/lib/cjs/header.js +2 -2
  40. package/lib/cjs/type/unit/Unit.js +15 -13
  41. package/lib/cjs/version.js +1 -1
  42. package/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js +20 -0
  43. package/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js +4 -0
  44. package/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js +4 -0
  45. package/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js +38 -0
  46. package/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js +18 -0
  47. package/lib/esm/entry/dependenciesAny.generated.js +3 -0
  48. package/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js +4 -0
  49. package/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js +4 -0
  50. package/lib/esm/entry/impureFunctionsAny.generated.js +34 -29
  51. package/lib/esm/entry/impureFunctionsNumber.generated.js +2 -0
  52. package/lib/esm/entry/pureFunctionsAny.generated.js +70 -36
  53. package/lib/esm/entry/pureFunctionsNumber.generated.js +2 -0
  54. package/lib/esm/expression/embeddedDocs/core/typed.js +1 -1
  55. package/lib/esm/expression/embeddedDocs/embeddedDocs.js +11 -3
  56. package/lib/esm/expression/embeddedDocs/function/{matrix → algebra}/lyap.js +2 -2
  57. package/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js +1 -1
  58. package/lib/esm/expression/embeddedDocs/function/{matrix → algebra}/schur.js +2 -2
  59. package/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js +1 -1
  60. package/lib/esm/expression/embeddedDocs/function/{matrix → algebra}/sylvester.js +2 -2
  61. package/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js +1 -1
  62. package/lib/esm/expression/embeddedDocs/function/expression/evaluate.js +2 -2
  63. package/lib/esm/expression/embeddedDocs/function/matrix/diff.js +1 -1
  64. package/lib/esm/expression/embeddedDocs/function/matrix/range.js +1 -1
  65. package/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js +8 -0
  66. package/lib/esm/expression/embeddedDocs/function/signal/freqz.js +8 -0
  67. package/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js +8 -0
  68. package/lib/esm/expression/embeddedDocs/function/utils/numeric.js +1 -1
  69. package/lib/esm/expression/transform/range.transform.js +7 -3
  70. package/lib/esm/factoriesAny.js +3 -0
  71. package/lib/esm/function/algebra/simplify.js +3 -0
  72. package/lib/esm/function/matrix/range.js +34 -110
  73. package/lib/esm/function/numeric/solveODE.js +284 -0
  74. package/lib/esm/function/signal/freqz.js +115 -0
  75. package/lib/esm/function/signal/zpk2tf.js +82 -0
  76. package/lib/esm/type/unit/Unit.js +15 -13
  77. package/lib/esm/version.js +1 -1
  78. package/package.json +6 -6
  79. package/types/index.d.ts +194 -50
package/types/index.d.ts CHANGED
@@ -13,10 +13,12 @@ type NoLiteralType<T> = T extends number
13
13
  : T
14
14
 
15
15
  declare namespace math {
16
+ // TODO: introduce generics for MathCollection, MathMatrix, and MathArray
16
17
  type MathNumericType = number | BigNumber | Fraction | Complex
17
- type MathArray = MathNumericType[] | MathNumericType[][]
18
+ type MathScalarType = MathNumericType | Unit
19
+ type MathArray = MathNumericType[] | MathNumericType[][] // TODO: MathArray can also contain Unit
18
20
  type MathCollection = MathArray | Matrix
19
- type MathType = MathNumericType | Unit | MathCollection
21
+ type MathType = MathScalarType | MathCollection
20
22
  type MathExpression = string | string[] | MathCollection
21
23
 
22
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1987,9 +1989,9 @@ declare namespace math {
1987
1989
  includeEnd?: boolean
1988
1990
  ): Matrix
1989
1991
  range(
1990
- start: number | BigNumber,
1991
- end: number | BigNumber,
1992
- step: number | BigNumber,
1992
+ start: number | BigNumber | Unit,
1993
+ end: number | BigNumber | Unit,
1994
+ step: number | BigNumber | Unit,
1993
1995
  includeEnd?: boolean
1994
1996
  ): Matrix
1995
1997
 
@@ -2564,6 +2566,28 @@ declare namespace math {
2564
2566
  */
2565
2567
  setUnion<T extends MathCollection>(a1: T, a2: MathCollection): T
2566
2568
 
2569
+ /*************************************************************************
2570
+ * Signal functions
2571
+ ************************************************************************/
2572
+ /**
2573
+ * Compute the transfer function of a zero-pole-gain model.
2574
+ * @param z Zeroes of the model
2575
+ * @param p Poles of the model
2576
+ * @param k Gain of the model
2577
+ * @returns The transfer function as array of numerator and denominator
2578
+ */
2579
+ zpk2tf<T extends MathCollection>(z: T, p: T, k?: number): T
2580
+
2581
+ /**
2582
+ * Calculates the frequency response of a filter given its numerator and denominator coefficients.
2583
+ * @param b The numerator polynomial of the filter
2584
+ * @param a The denominator polynomial of the filter
2585
+ * @param w The range of frequencies in which the response is to be calculated
2586
+ * @returns The frequency response
2587
+ *
2588
+ */
2589
+ freqz<T extends MathCollection>(b: T, a: T, w?: number | T): { w: T; h: T }
2590
+
2567
2591
  /*************************************************************************
2568
2592
  * Special functions
2569
2593
  ************************************************************************/
@@ -2595,35 +2619,60 @@ declare namespace math {
2595
2619
  * of a multi dimensional array, the maximum of the flattened array will
2596
2620
  * be calculated. When dim is provided, the maximum over the selected
2597
2621
  * dimension will be calculated. Parameter dim is zero-based.
2598
- * @param args A single matrix or multiple scalar values
2622
+ * @param args Multiple scalar values
2599
2623
  * @returns The maximum value
2600
2624
  */
2601
- max<T extends MathType[]>(...args: T): T[number]
2625
+ max<T extends MathScalarType>(...args: T[]): T
2626
+ /**
2627
+ * @param args Multiple scalar values
2628
+ * @returns The maximum value
2629
+ */
2630
+ max(...args: MathScalarType[]): MathScalarType
2602
2631
  /**
2603
2632
  * @param A A single matrix
2604
- * @param dim The maximum over the selected dimension
2633
+ * @param dimension The maximum over the selected dimension
2605
2634
  * @returns The maximum value
2606
2635
  */
2607
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2608
- max(A: MathCollection, dim?: number): any
2636
+ max<T extends MathScalarType>(
2637
+ A: T[] | T[][],
2638
+ dimension?: number | BigNumber
2639
+ ): T
2640
+ /**
2641
+ * @param A A single matrix
2642
+ * @param dimension The maximum over the selected dimension
2643
+ * @returns The maximum value
2644
+ */
2645
+ max(A: MathCollection, dimension?: number | BigNumber): MathScalarType
2609
2646
 
2610
2647
  /**
2611
2648
  * Compute the mean value of matrix or a list with values. In case of a
2612
2649
  * multi dimensional array, the mean of the flattened array will be
2613
2650
  * calculated. When dim is provided, the maximum over the selected
2614
2651
  * dimension will be calculated. Parameter dim is zero-based.
2615
- * @param args A single matrix or multiple scalar values
2652
+ * @param args Multiple scalar values
2616
2653
  * @returns The mean of all values
2617
2654
  */
2618
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2619
- mean(...args: MathType[]): any
2655
+ mean<T extends MathScalarType>(...args: T[]): T
2656
+ /**
2657
+ * @param args Multiple scalar values
2658
+ * @returns The mean value
2659
+ */
2660
+ mean(...args: MathScalarType[]): MathScalarType
2620
2661
  /**
2621
2662
  * @param A A single matrix
2622
- * @param dim The mean over the selected dimension
2623
- * @returns The mean of all values
2663
+ * @param dimension The mean over the selected dimension
2664
+ * @returns The mean value
2624
2665
  */
2625
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2626
- mean(A: MathCollection, dim?: number): any
2666
+ mean<T extends MathScalarType>(
2667
+ A: T[] | T[][],
2668
+ dimension?: number | BigNumber
2669
+ ): T
2670
+ /**
2671
+ * @param A A single matrix
2672
+ * @param dimension The mean over the selected dimension
2673
+ * @returns The mean value
2674
+ */
2675
+ mean(A: MathCollection, dimension?: number | BigNumber): MathScalarType
2627
2676
 
2628
2677
  /**
2629
2678
  * Compute the median of a matrix or a list with values. The values are
@@ -2632,48 +2681,103 @@ declare namespace math {
2632
2681
  * types of values are: Number, BigNumber, Unit In case of a (multi
2633
2682
  * dimensional) array or matrix, the median of all elements will be
2634
2683
  * calculated.
2635
- * @param args A single matrix or or multiple scalar values
2636
- * @returns The median
2684
+ * @param args Multiple scalar values
2685
+ * @returns The median value
2637
2686
  */
2638
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2639
- median(...args: MathType[]): any
2687
+ median<T extends MathScalarType>(...args: T[]): T
2688
+ /**
2689
+ * @param args Multiple scalar values
2690
+ * @returns The median value
2691
+ */
2692
+ median(...args: MathScalarType[]): MathScalarType
2693
+ /**
2694
+ * @param A A single matrix
2695
+ * @returns The median value
2696
+ */
2697
+ median<T extends MathScalarType>(A: T[] | T[][]): T
2698
+ /**
2699
+ * @param A A single matrix
2700
+ * @returns The median value
2701
+ */
2702
+ median(A: MathCollection): MathScalarType
2640
2703
 
2641
2704
  /**
2642
2705
  * Compute the minimum value of a matrix or a list of values. In case of
2643
2706
  * a multi dimensional array, the minimum of the flattened array will be
2644
2707
  * calculated. When dim is provided, the minimum over the selected
2645
2708
  * dimension will be calculated. Parameter dim is zero-based.
2646
- * @param args A single matrix or or multiple scalar values
2709
+ * @param args multiple scalar values
2710
+ * @returns The minimum value
2711
+ */
2712
+ min<T extends MathScalarType>(...args: T[]): T
2713
+ /**
2714
+ * @param args Multiple scalar values
2647
2715
  * @returns The minimum value
2648
2716
  */
2649
- min<T extends MathType[]>(...args: T): T[number]
2717
+ min(...args: MathScalarType[]): MathScalarType
2650
2718
  /**
2651
2719
  * @param A A single matrix
2652
- * @param dim The minimum over the selected dimension
2720
+ * @param dimension The minimum over the selected dimension
2653
2721
  * @returns The minimum value
2654
2722
  */
2655
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2656
- min(A: MathCollection, dim?: number): any
2723
+ min<T extends MathScalarType>(
2724
+ A: T[] | T[][],
2725
+ dimension?: number | BigNumber
2726
+ ): T
2727
+ /**
2728
+ * @param A A single matrix
2729
+ * @param dimension The minimum over the selected dimension
2730
+ * @returns The minimum value
2731
+ */
2732
+ min(A: MathCollection, dimension?: number | BigNumber): MathScalarType
2657
2733
 
2658
2734
  /**
2659
2735
  * Computes the mode of a set of numbers or a list with values(numbers
2660
2736
  * or characters). If there are more than one modes, it returns a list
2661
2737
  * of those values.
2662
- * @param args A single matrix
2738
+ * @param args Multiple scalar values
2663
2739
  * @returns The mode of all values
2664
2740
  */
2665
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2666
- mode(...args: MathType[]): any
2741
+ mode<T extends MathScalarType>(...args: T[]): T
2742
+ /**
2743
+ * @param args Multiple scalar values
2744
+ * @returns The mode of all values
2745
+ */
2746
+ mode(...args: MathScalarType[]): MathScalarType
2747
+ /**
2748
+ * @param A A single matrix
2749
+ * @returns The median value
2750
+ */
2751
+ mode<T extends MathScalarType>(A: T[] | T[][]): T
2752
+ /**
2753
+ * @param A A single matrix
2754
+ * @returns The mode of all values
2755
+ */
2756
+ mode(A: MathCollection): MathScalarType
2667
2757
 
2668
2758
  /**
2669
2759
  * Compute the product of a matrix or a list with values. In case of a
2670
2760
  * (multi dimensional) array or matrix, the sum of all elements will be
2671
2761
  * calculated.
2672
- * @param args A single matrix or multiple scalar values
2762
+ * @param args Multiple scalar values
2673
2763
  * @returns The product of all values
2674
2764
  */
2675
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2676
- prod(...args: MathType[]): any
2765
+ prod<T extends MathScalarType>(...args: T[]): T
2766
+ /**
2767
+ * @param args Multiple scalar values
2768
+ * @returns The product of all values
2769
+ */
2770
+ prod(...args: MathScalarType[]): MathScalarType
2771
+ /**
2772
+ * @param A A single matrix
2773
+ * @returns The product of all values
2774
+ */
2775
+ prod<T extends MathScalarType>(A: T[] | T[][]): T
2776
+ /**
2777
+ * @param A A single matrix
2778
+ * @returns The product of all values
2779
+ */
2780
+ prod(A: MathCollection): MathScalarType
2677
2781
 
2678
2782
  /**
2679
2783
  * Compute the prob order quantile of a matrix or a list with values.
@@ -2705,10 +2809,15 @@ declare namespace math {
2705
2809
  * values: 'unbiased' (default) The sum of squared errors is divided by
2706
2810
  * (n - 1) 'uncorrected' The sum of squared errors is divided by n
2707
2811
  * 'biased' The sum of squared errors is divided by (n + 1)
2708
- * @param a variadic argument of number to calculate standard deviation
2709
- * @returns The standard deviation array
2812
+ * @param args variadic argument of number to calculate standard deviation
2813
+ * @returns The standard deviation
2814
+ */
2815
+ std<T extends MathScalarType>(...args: T[]): T
2816
+ /**
2817
+ * @param args Multiple scalar values
2818
+ * @returns The standard deviation
2710
2819
  */
2711
- std(...values: number[]): number
2820
+ std(...args: MathScalarType[]): MathScalarType
2712
2821
  /**
2713
2822
  * Compute the standard deviation of a matrix or a list with values. The
2714
2823
  * standard deviations is defined as the square root of the variance:
@@ -2730,7 +2839,7 @@ declare namespace math {
2730
2839
  array: MathCollection,
2731
2840
  dimension?: number,
2732
2841
  normalization?: 'unbiased' | 'uncorrected' | 'biased'
2733
- ): number[]
2842
+ ): MathNumericType[]
2734
2843
  /**
2735
2844
  * Compute the standard deviation of a matrix or a list with values. The
2736
2845
  * standard deviations is defined as the square root of the variance:
@@ -2750,7 +2859,7 @@ declare namespace math {
2750
2859
  std(
2751
2860
  array: MathCollection,
2752
2861
  normalization: 'unbiased' | 'uncorrected' | 'biased'
2753
- ): number
2862
+ ): MathNumericType
2754
2863
 
2755
2864
  /**
2756
2865
  * Compute the sum of a matrix or a list with values. In case of a
@@ -2759,14 +2868,27 @@ declare namespace math {
2759
2868
  * @param args A single matrix or multiple scalar values
2760
2869
  * @returns The sum of all values
2761
2870
  */
2762
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2763
- sum(...args: Array<number | BigNumber | Fraction>): any
2871
+ sum<T extends MathScalarType>(...args: T[]): T
2764
2872
  /**
2765
- * @param array A single matrix
2873
+ * @param args Multiple scalar values
2766
2874
  * @returns The sum of all values
2767
2875
  */
2768
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2769
- sum(array: MathCollection): any
2876
+ sum(...args: MathScalarType[]): MathScalarType
2877
+ /**
2878
+ * @param A A single matrix
2879
+ * @param dimension The sum over the selected dimension
2880
+ * @returns The sum of all values
2881
+ */
2882
+ sum<T extends MathScalarType>(
2883
+ A: T[] | T[][],
2884
+ dimension?: number | BigNumber
2885
+ ): T
2886
+ /**
2887
+ * @param A A single matrix
2888
+ * @param dimension The sum over the selected dimension
2889
+ * @returns The sum of all values
2890
+ */
2891
+ sum(A: MathCollection, dimension?: number | BigNumber): MathScalarType
2770
2892
 
2771
2893
  /**
2772
2894
  * Count the number of elements of a matrix, array or string.
@@ -2804,8 +2926,7 @@ declare namespace math {
2804
2926
  * @param args A single matrix or multiple scalar values
2805
2927
  * @returns The variance
2806
2928
  */
2807
- variance(...args: Array<number | BigNumber | Fraction>): number
2808
-
2929
+ variance(...args: MathNumericType[]): MathNumericType
2809
2930
  /**
2810
2931
  * Compute the variance of a matrix or a list with values. In case of a
2811
2932
  * (multi dimensional) array or matrix, the variance over all elements
@@ -2828,7 +2949,7 @@ declare namespace math {
2828
2949
  array: MathCollection,
2829
2950
  dimension?: number,
2830
2951
  normalization?: 'unbiased' | 'uncorrected' | 'biased'
2831
- ): number[]
2952
+ ): MathNumericType[]
2832
2953
  /**
2833
2954
  * @param array A single matrix
2834
2955
  * @param normalization normalization Determines how to normalize the
@@ -2839,7 +2960,7 @@ declare namespace math {
2839
2960
  variance(
2840
2961
  array: MathCollection,
2841
2962
  normalization: 'unbiased' | 'uncorrected' | 'biased'
2842
- ): number
2963
+ ): MathNumericType
2843
2964
 
2844
2965
  /*************************************************************************
2845
2966
  * String functions
@@ -3512,6 +3633,8 @@ declare namespace math {
3512
3633
  setSizeDependencies: FactoryFunctionMap
3513
3634
  setSymDifferenceDependencies: FactoryFunctionMap
3514
3635
  setUnionDependencies: FactoryFunctionMap
3636
+ zpk2tfDependencies: FactoryFunctionMap
3637
+ freqzDependencies: FactoryFunctionMap
3515
3638
  addDependencies: FactoryFunctionMap
3516
3639
  hypotDependencies: FactoryFunctionMap
3517
3640
  normDependencies: FactoryFunctionMap
@@ -3781,7 +3904,7 @@ declare namespace math {
3781
3904
  equalBase(unit: Unit): boolean
3782
3905
  equals(unit: Unit): boolean
3783
3906
  multiply(unit: Unit): Unit
3784
- divide(unit: Unit): Unit
3907
+ divide(unit: Unit): Unit | number
3785
3908
  pow(unit: Unit): Unit
3786
3909
  abs(unit: Unit): Unit
3787
3910
  to(unit: string): Unit
@@ -5354,9 +5477,9 @@ declare namespace math {
5354
5477
  includeEnd?: boolean
5355
5478
  ): MathJsChain<Matrix>
5356
5479
  range(
5357
- this: MathJsChain<number | BigNumber>,
5358
- end: number | BigNumber,
5359
- step: number | BigNumber,
5480
+ this: MathJsChain<number | BigNumber | Unit>,
5481
+ end: number | BigNumber | Unit,
5482
+ step: number | BigNumber | Unit,
5360
5483
  includeEnd?: boolean
5361
5484
  ): MathJsChain<Matrix>
5362
5485
 
@@ -5821,6 +5944,27 @@ declare namespace math {
5821
5944
  a2: MathCollection
5822
5945
  ): MathJsChain<T>
5823
5946
 
5947
+ /*************************************************************************
5948
+ * Signal functions
5949
+ ************************************************************************/
5950
+ /**
5951
+ * Compute the transfer function of a zero-pole-gain model.
5952
+ */
5953
+ zpk2tf<T extends MathCollection>(
5954
+ this: MathJsChain<T>, // chained variable will be used as z
5955
+ p: T,
5956
+ k?: number
5957
+ ): MathJsChain<T>
5958
+
5959
+ /**
5960
+ * Calculates the frequency response of a filter given its numerator and denominator coefficients.
5961
+ */
5962
+ freqz<T extends number | MathArray | MathArray[]>(
5963
+ this: MathJsChain<T>,
5964
+ a: T,
5965
+ w?: T | number
5966
+ ): MathJsChain<{ w: T; h: T }>
5967
+
5824
5968
  /*************************************************************************
5825
5969
  * Special functions
5826
5970
  ************************************************************************/