Kamis, 08 Juni 2023

Math functions in Math.js

Math.js (math library for JavaScript and Node.js) supports all the math functions that are available in the following list:

Construction functions:

  • bignumber(x)
  • boolean(x)
  • chain(value)
  • complex(re, im)
  • createUnit(units)
  • fraction(numerator, denominator)
  • index(range1, range2, …)
  • matrix(x)
  • number(value)
  • sparse(x)
  • splitUnit(unit, parts)
  • string(value)

Expression functions:

  • compile(expr)
  • eval(expr [, scope])
  • help(search)
  • parse(expr [, scope])
  • parser()

Arithmetic functions:

  • abs(x)
  • add(x, y)
  • cbrt(x [, allRoots])
  • ceil(x)
  • cube(x)
  • divide(x, y)
  • dotDivide(x, y)
  • dotMultiply(x, y)
  • dotPow(x, y)
  • exp(x)
  • expm1(x)
  • fix(x)
  • floor(x)
  • gcd(a, b)
  • hypot(a, b, …)
  • lcm(a, b)
  • log(x [, base])
  • log10(x)
  • log1p(x)
  • log2(x)
  • mod(x, y)
  • multiply(x, y)
  • norm(x [, p])
  • nthRoot(a)
  • nthRoots(x)
  • pow(x, y)
  • round(x [, n])
  • sign(x)
  • sqrt(x)
  • square(x)
  • subtract(x, y)
  • unaryMinus(x)
  • unaryPlus(x)
  • xgcd(a, b)

Bitwise functions:

  • bitAnd(x, y)
  • bitNot(x)
  • bitOr(x, y)
  • bitXor(x, y)
  • leftShift(x, y)
  • rightArithShift(x, y)
  • rightLogShift(x, y)

Combinatorics functions:

  • bellNumbers(n)
  • catalan(n)
  • composition(n, k)
  • stirlingS2(n, k)

Complex functions:

  • arg(x)
  • conj(x)
  • im(x)
  • re(x)

Geometry functions:

  • distance([x1, y1], [x2, y2])
  • intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2)

Logical functions:

  • and(x, y)
  • not(x)
  • or(x, y)
  • xor(x, y)

Matrix functions:

  • concat(a, b, c, … [, dim])
  • cross(x, y)
  • ctranspose(x)
  • det(x)
  • diag(X)
  • dot(x, y)
  • expm(x)
  • filter(x, test)
  • flatten(x)
  • forEach(x, callback)
  • getMatrixDataType(x)numbers.
  • identity(n)
  • inv(x)
  • kron(x, y)
  • map(x, callback)
  • ones(m, n, p, …)
  • partitionSelect(x, k)
  • range(start, end [, step])
  • reshape(x, sizes)
  • resize(x, size [, defaultValue])
  • size(x)
  • sort(x)
  • squeeze(x)
  • subset(x, index [, replacement])
  • trace(x)
  • transpose(x)
  • zeros(m, n, p, …)

Probability functions:

  • combinations(n, k)
  • factorial(n)
  • gamma(n)
  • kldivergence(x, y)
  • multinomial(a)
  • permutations(n [, k])
  • pickRandom(array)
  • random([min, max])
  • randomInt([min, max])

Relational functions:

  • compare(x, y)
  • compareNatural(x, y)
  • compareText(x, y)
  • deepEqual(x, y)
  • equal(x, y)
  • equalText(x, y)
  • larger(x, y)
  • largerEq(x, y)
  • smaller(x, y)
  • smallerEq(x, y)
  • unequal(x, y)

Set functions:

  • setCartesian(set1, set2)
  • setDifference(set1, set2)
  • setDistinct(set)
  • setIntersect(set1, set2)
  • setIsSubset(set1, set2)
  • setMultiplicity(element, set)
  • setPowerset(set)
  • setSize(set)
  • setSymDifference(set1, set2)
  • setUnion(set1, set2)

Special functions:

  • erf(x)

Statistics functions:

  • mad(a, b, c, …)
  • max(a, b, c, …)
  • mean(a, b, c, …)
  • median(a, b, c, …)
  • min(a, b, c, …)
  • mode(a, b, c, …)
  • prod(a, b, c, …)
  • quantileSeq(A, prob[, sorted])
  • std(a, b, c, …)
  • sum(a, b, c, …)
  • var(a, b, c, …)

String functions:

  • math.format(value [, precision])
  • math.print(template, values [, precision])

Trigonometry functions:

  • acos(x)
  • acosh(x)
  • acot(x)
  • acoth(x)
  • acsc(x)
  • acsch(x)
  • asec(x)
  • asech(x)
  • asin(x)
  • asinh(x)
  • atan(x)
  • atan2(y, x)
  • atanh(x)
  • cos(x)
  • cosh(x)
  • cot(x)
  • coth(x)
  • csc(x)
  • csch(x)
  • sec(x)
  • sech(x)
  • sin(x)
  • sinh(x)
  • tan(x)
  • tanh(x)

Unit functions:

  • to(x, unit)

Utils functions:

  • clone(x)
  • isInteger(x)
  • isNaN(x)
  • isNegative(x)
  • isNumeric(x)
  • isPositive(x)
  • isPrime(x)
  • isZero(x)
  • typeof(x)

Bibliography:

JavaScript: The Definitive Guide, David Flanagan, O'Reilly
https://ieeexplore.ieee.org/
https://mathjs.org/
https://developer.mozilla.org/

Tidak ada komentar:

Posting Komentar