Skip to content

Commit 0fde146

Browse files
committed
Support TMath::Sq() function
Used with "pol2" fitting
1 parent 0116ec2 commit 0fde146

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/base/math.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,12 @@ function Prob(chi2, ndf) {
15931593
return chisquared_cdf_c(chi2,ndf,0);
15941594
}
15951595

1596+
/** @summary Square function
1597+
* @memberof Math */
1598+
function Sq(x) {
1599+
return x * x;
1600+
}
1601+
15961602
/** @summary Gaus function
15971603
* @memberof Math */
15981604
function Gaus(x, mean, sigma, norm) {
@@ -2050,7 +2056,7 @@ export { gamma, gamma as tgamma, gamma as Gamma,
20502056
tdistribution_cdf_c, tdistribution_cdf, tdistribution_pdf, exponential_cdf_c, exponential_cdf, chisquared_pdf,
20512057
Beta, GammaDist, LaplaceDist, LaplaceDistI, LogNormal, Student, StudentI,
20522058
gaus, gausn, gausxy, expo,
2053-
Prob, Gaus, BreitWigner, BetaDist, BetaDistI, landau, landaun,
2059+
Prob, Sq, Gaus, BreitWigner, BetaDist, BetaDistI, landau, landaun,
20542060

20552061
ChebyshevN, Chebyshev0, Chebyshev1, Chebyshev2, Chebyshev3, Chebyshev4,
20562062
Chebyshev5, Chebyshev6, Chebyshev7, Chebyshev8, Chebyshev9, Chebyshev10,

0 commit comments

Comments
 (0)