Math Function

Unfold Hierarchy number Tags Values

      Math Function
        1  Examples
            1.1  Constants
                1.1.1  pi
ExpressionMath.PI
                1.1.2  Euler number
ExpressionMath.E
                1.1.3  natural logarithm of 2
ExpressionMath.LN2
                1.1.4  natural logarithm of 10
ExpressionMath.LN10
                1.1.5  base-2 logarithm of e
ExpressionMath.LOG2E
                1.1.6  base-10 logarithm of e
ExpressionMath.LOG10E
                1.1.7  square root of 2
ExpressionMath.SQRT2
                1.1.8  square root of 0.5
ExpressionMath.SQRT1_2
                1.1.9  Random
ExpressionMath.random()
                1.1.10  largest positive finite value of the number type
ExpressionNumber.MAX_VALUE
                1.1.11  smallest positive nonzero value of the number type
ExpressionNumber.MIN_VALUE
                1.1.12  positive infinite value
ExpressionNumber.POSITIVE_INFINITY
                1.1.13  negative infinite value
ExpressionNumber.NEGATIVE_INFINITY
                1.1.14  non-numeric
ExpressionNumber.NaN
            1.2  Unary Function
                1.2.1  absoluate
Variablesx
ExpressionMath.abs(x)
                1.2.2  Trigonometry
                    1.2.2.1  convert angle to radian
Variablesangle
Expressionangle * Math.PI / 180
                    1.2.2.2  convert radian to angle
Variablesradian
Expressionradian * 180 / Math.PI
                    1.2.2.3  cosine_radian
Variablesradian
ExpressionMath.cos(radian)
                    1.2.2.4  sine_radian
Variablesradian
ExpressionMath.sin(radian)
                    1.2.2.5  tangent_radian
Variablesradian
ExpressionMath.tan(radian)
Function domain( radian - Math.PI / 2 ) % Math.PI != 0
                    1.2.2.6  arcCosine_radian
Variablesx
ExpressionMath.acos(x)
Function domainx >= -1 && x <= 1
                    1.2.2.7  arcSine_radian
Variablesx
ExpressionMath.asin(x)
Function domainx >= -1 && x <= 1
                    1.2.2.8  arcTangent_radian
Variablesx
ExpressionMath.atan(x)
                    1.2.2.9  cosine_angle
Variablesangle
ExpressionMath.cos( angle * Math.PI / 180)
                    1.2.2.10  sine_angle
Variablesangle
ExpressionMath.sin( angle * Math.PI / 180)
                    1.2.2.11  tangent_angle
Variablesangle
ExpressionMath.tan( angle * Math.PI / 180)
Function domain( angle - 90 ) % 180 != 0
                    1.2.2.12  arcCosine_ angle
Variablesx
ExpressionMath.acos(x) * 180 / Math.PI
Function domainx >= -1 && x <= 1
                    1.2.2.13  arcSine_angle
Variablesx
ExpressionMath.asin(x) * 180 / Math.PI
Function domainx >= -1 && x <= 1
                    1.2.2.14  arcTangent_angle
Variablesx
ExpressionMath.atan(x) * 180 / Math.PI
                1.2.3  Geometry
                    1.2.3.1  area of circle - radius
Variablesradius
ExpressionMath.PI * radius * radius
Function domainradius > 0
                    1.2.3.2  area of circle - diameter
Variablesdiameter
Expressionvar r = diameter / 2.0; Math.PI * r * r
Function domaindiameter > 0
                    1.2.3.3  area of sphere - radius
Variablesradius
Expression4 * Math.PI * radius * radius
Function domainradius > 0
                    1.2.3.4  area of sphere - diameter
Variablesdiameter
ExpressionMath.PI * diameter * diameter
Function domaindiameter > 0
                    1.2.3.5  volume of sphere - radius
Variablesradius
Expression4 * Math.PI * Math.pow(radius,3) / 3
Function domainradius > 0
                    1.2.3.6  volume of sphere - diameter
Variablesdiameter
ExpressionMath.PI * Math.pow(diameter,3) / 6
Function domaindiameter > 0
                1.2.4  Power Function
                    1.2.4.1  square
Variablesx
ExpressionMath.pow(x,2)
                    1.2.4.2  cubic
Variablesx
ExpressionMath.pow(x,3)
                    1.2.4.3  quartic
Variablesx
ExpressionMath.pow(x,4)
                    1.2.4.4  quintic
Variablesx
ExpressionMath.pow(x,5)
                    1.2.4.5  square_root
Variablesx
ExpressionMath.sqrt(x)
Function domainx >= 0
                    1.2.4.6  cubic_root
Variablesx
ExpressionMath.pow(x,1/3)
Function domainx >= 0
                    1.2.4.7  quartic_root
Variablesx
ExpressionMath.pow(x,1/4)
Function domainx >= 0
                    1.2.4.8  quintic_root
Variablesx
ExpressionMath.pow(x,1/5)
Function domainx >= 0
                    1.2.4.9  reciprocal
Variablesx
ExpressionMath.pow(x,-1)
Function domainx != 0
                    1.2.4.10  quadratic_reciprocal
Variablesx
ExpressionMath.pow(x,-2)
Function domainx != 0
                    1.2.4.11  cubic_reciprocal
Variablesx
ExpressionMath.pow(x,-3)
Function domainx != 0
                1.2.5  Exponential Function
                    1.2.5.1  exponential_of_e
Variablesx
ExpressionMath.exp(x + 5)
                    1.2.5.2  exponential_base_greater_than_1
Variablesx
ExpressionMath.pow(5.9,x)
                    1.2.5.3  exponential_base_less_than_1
Variablesx
ExpressionMath.pow(0.7,x)
                1.2.6  Logarithmic Function
                    1.2.6.1  natural_logarithm
Variablesx
ExpressionMath.log(x)
Function domainx > 0
                1.2.7  Intercept Function
                    1.2.7.1  round_up
Variablesx
ExpressionMath.ceil(x)
                    1.2.7.2  round_down
Variablesx
ExpressionMath.floor(x)
                    1.2.7.3  round
Variablesx
ExpressionMath.round(x)
                    1.2.7.4  trunc
Variablesx
ExpressionMath.trunc(x)
                1.2.8  Unitary Polynomial
                    1.2.8.1  unitary_linear_function
Variablesx
Expression5 * x + 9
                    1.2.8.2  unitary_quadratic_function
Variablesx
Expression5 * Math.pow(x,2) + 3 * x + 9
                    1.2.8.3  unitary_cubic_function
Variablesx
Expression6 * Math.pow(x,3) + 5 * Math.pow(x,2) + 3 * x + 9
                    1.2.8.4  unitary_quartic_function
Variablesx
Expression7 * Math.pow(x,4) + 6 * Math.pow(x,3) + 5 * Math.pow(x,2) + 3 * x + 9
                    1.2.8.5  unitary_quintic_function
Variablesx
Expression8 * Math.pow(x,5) +7 * Math.pow(x,4) + 6 * Math.pow(x,3) + 5 * Math.pow(x,2) + 3 * x + 9
                1.2.9  piecewise values
                    1.2.9.1  direct values
Variablesx
Expressionif ( x > 1 ) 6 * x - 5.9; else if ( x == 1) 38; else Math.pow(x, 2) + 2.7;
                    1.2.9.2  define functions
Variablesx
Expressionfunction f1(x) { var multiply = 1; for (var i = 1; i <= Math.abs(x); i++) { multiply = multiply * i; } return multiply ; } function f2(x) { var sum = 0; for (var i = 1; i > x; i--) { sum += f1(i); } return sum; } if ( x > 1 ) f1(x); else if ( x == 1) 38; else f2(x);
                1.2.10  Numerical Analysis
                    1.2.10.1  Unary Normal probability density function
Variablesx
Expressionvar mean = 1; var stdDeviation = 2; var dx = x - mean; var expP = - dx * dx / ( 2 * stdDeviation * stdDeviation ); var div = Math.sqrt(2 * Math.PI) * stdDeviation; Math.exp(expP) / div
                    1.2.10.2  Unary Standard normal probability density function
Variablesx
ExpressionMath.exp(- x * x / 2) / Math.sqrt(2 * Math.PI)
                    1.2.10.3  sigmoid
Variablesx
Expression1 / (1 + Math.exp(-x))
                    1.2.10.4  derivative of sigmoid
Variablesx
Expressionvar s = 1 / (1 + Math.exp(-x)); s * (1 - s);
            1.3  Binary Function
                1.3.1  Univariate Polynomial
                    1.3.1.1  univariate linear polynomial
Variablesx,y
Expression5 * x + 9 * y - 4
                    1.3.1.2  univariate quadratic polynomial
Variablesx,y
Expression5 * x * x + 3 * y * y + y + 9
                    1.3.1.3  univariate cubic polynomial
Variablesx,y
Expression6 * Math.pow(x,3) + 5 * Math.pow(y,2) + 3 * y + 9
                    1.3.1.4  univariate quartic polynomial
Variablesx,y
Expression7 * Math.pow(x,4) + 6 * Math.pow(y,3) + 5 * Math.pow(x,2) + 3 * y + 9
                    1.3.1.5  univariate quintic polynomial
Variablesx,y
Expression8 * Math.pow(x,5) +7 * Math.pow(y,5) + 6 * Math.pow(x,3) + 5 * Math.pow(y,2) + 3 * x + 9
                1.3.2  Geometry
                    1.3.2.1  volume of cylinder
Variablesradius,height
ExpressionMath.PI * radius * radius * height
                    1.3.2.2  area of ellipse - half_axle
Variableslong_half_axle,short_half_axle
ExpressionMath.PI * long_half_axle * short_half_axle
Function domainlong_half_axle > 0 && short_half_axle > 0
                    1.3.2.3  area of ellipse - axle
Variableslong_axle,short_axle
ExpressionMath.PI * long_axle * short_axle / 4
Function domainlong_axle > 0 && short_axle > 0
                1.3.3  Quadric Surface
                1.3.4  Trigonometry
                    1.3.4.1  univariate linear trigonometry
Variablesx,y
Expression5 * Math.sin(x) + 3 * y + 9
                    1.3.4.2  univariate quadratic trigonometry
Variablesx,y
Expression5 * Math.cos(x * x) + 3 * Math.sin(y) * Math.sin(y) + 9
                    1.3.4.3  univariate cubic trigonometry
Variablesx,y
Expression5 * Math.tan(x * x * x) + 3 * Math.cos(x) * Math.sin(y) + 9
                1.3.5  Exponential Function
                    1.3.5.1  univariate exponential
Variablesx,y
Expression5 * Math.exp(x - 2 * y) + 3 * x - y + 9
                1.3.6  Logarithmic Function
                    1.3.6.1  univariate logarithmic
Variablesx,y
Expression5 * Math.log(x * y) - 9
Function domainx * y > 0
                1.3.7  Numerical Analysis
                    1.3.7.1  Univariate Normal probability density function
Variablesx,y
Expressionvar xMean = 1; var xStd = 2; var yMean = 2; var yStd = 1; var coefficient = 0.2; var dx = x - xMean; var dy = y - yMean; var xyStd = xStd * yStd; var dco = 1 - coefficient * coefficient; var px = dx * dx / ( xStd * xStd ); var py = dy * dy / ( yStd * yStd ); var pxy = 2 * coefficient * dx * dy / xyStd; var expP = - (px + py - pxy) / ( 2 * dco) var div = 2 * Math.PI * xyStd * Math.sqrt(dco); Math.exp(expP) / div
                    1.3.7.2  Univariate Standard normal probability density function
Variablesx,y
Expressionvar xMean = 1; var xStd = 2; var yMean = 2; var yStd = 1; var dx = x - xMean; var dy = y - yMean; var xyStd = xStd * yStd; var px = dx * dx / ( xStd * xStd ); var py = dy * dy / ( yStd * yStd ); var expP = - (px + py) / 2 var div = 2 * Math.PI * xyStd; Math.exp(expP) / div
            1.4  Ternary Function
                1.4.1  Trigonometry
                    1.4.1.1  law of sines - for angle(radian)
VariablesangleA_radian ,edge_a,edge_b
Expressionvar sinB = Math.sin(angleA_radian ) * edge_b / edge_a; Math.asin(sinB)
Function domainangleA_radian > 0 && edge_a > 0 && edge_b > 0
                    1.4.1.2  law of sines - for angle(angle)
VariablesangleA_angle ,edge_a,edge_b
Expressionvar sinA = Math.sin(angleA_angle * Math.PI / 180); var sinB = sinA * edge_b / edge_a; Math.asin(sinB) * 180 / Math.PI
Function domainangleA_angle > 0 && edge_a > 0 && edge_b > 0
                    1.4.1.3  law of sines - for edge(radian)
VariablesangleA_radian ,edge_a,angleB_radian
Expressionedge_a * Math.sin(angleB_radian ) / Math.sin(angleA_radian )
Function domainangleA_radian > 0 && angleB_radian > 0 && edge_a > 0
                    1.4.1.4  law of sines - for edge(angle)
VariablesangleA_angle ,edge_a,angleB_angle
Expressionvar sinA = Math.sin(angleA_angle * Math.PI / 180); var sinB = Math.sin(angleB_angle * Math.PI / 180); edge_a * sinB / sinA
Function domainangleA_angle > 0 && angleB_angle > 0 && edge_a > 0
                    1.4.1.5  law of cosines - for edge(radian)
VariablesangleA_radian ,edge_b,edge_c
ExpressionMath.sqrt(edge_b * edge_b + edge_c * edge_c - 2 * edge_b * edge_c * Math.cos(angleA_radian ))
Function domainangleA_radian > 0 && edge_b > 0 && edge_c > 0
                    1.4.1.6  law of cosines - for edge(angle)
VariablesangleA_angle ,edge_b,edge_c
Expressionvar cosA = Math.cos(angleA_angle * Math.PI / 180); Math.sqrt(edge_b * edge_b + edge_c * edge_c - 2 * edge_b * edge_c * cosA)
Function domainangleA_angle > 0 && edge_b > 0 && edge_c > 0
                    1.4.1.7  law of cosines - for angle(radian)
Variablesedge_a,edge_b,edge_c
Expressionvar cosA = (edge_b * edge_b + edge_c * edge_c - edge_a * edge_a) / (2 * edge_b * edge_c); Math.acos( cosA )
Function domainedge_a > 0 && edge_b > 0 && edge_c > 0
                    1.4.1.8  law of cosines - for angle(angle)
Variablesedge_a,edge_b,edge_c
Expressionvar cosA = (edge_b * edge_b + edge_c * edge_c - edge_a * edge_a) / (2 * edge_b * edge_c); Math.acos( cosA ) * 180 / Math.PI
Function domainedge_a > 0 && edge_b > 0 && edge_c > 0
                1.4.2  Geometry
                    1.4.2.1  area of ellipsoid - half_axie
Variableshalf_axie_a,half_axie_b,half_axie_c
Expression4 * Math.PI * ( half_axie_a * half_axie_b + half_axie_a * half_axie_c + half_axie_b * half_axie_c )/ 3
Function domainhalf_axie_a > 0 && half_axie_b > 0 && half_axie_c > 0
                    1.4.2.2  area of ellipsoid - axie
Variablesaxie_a,axie_b,axie_c
ExpressionMath.PI * ( axie_a * axie_b + axie_a * axie_c + axie_b * axie_c )/ 3
Function domainaxie_a > 0 && axie_b > 0 && _axie_c > 0
                    1.4.2.3  volumn of ellipsoid - half_axie
Variableshalf_axie_a,half_axie_b,half_axie_c
Expression4 * Math.PI * half_axie_a * half_axie_b * half_axie_c / 3
Function domainhalf_axie_a > 0 && half_axie_b > 0 && half_axie_c > 0
                    1.4.2.4  volumn of ellipsoid - axie
Variablesaxie_a,axie_b,axie_c
ExpressionMath.PI * axie_a * axie_b * axie_c / 6
Function domainaxie_a > 0 && axie_b > 0 && axie_c > 0
                    1.4.2.5  area of cube
Variableslength,width,height
Expression2 * ( length * width + length * height + width * height )
Function domainlength > 0 && width > 0 && height > 0
                    1.4.2.6  volumn of cube
Variableslength,width,height
Expressionlength * width * height
Function domainlength > 0 && width > 0 && height > 0