The following is a list of functions and operators that are provided by native VBScript:
Function |
Description |
^ |
Raises a number to the power of an exponent. |
* |
Multiplies two numbers. |
/ |
Divides two numbers and returns a floating-point result. |
\ |
Divides two numbers and returns an integer result. |
Mod |
Divides two numbers and returns only the remainder. |
+ |
Sums two numbers. |
- |
Finds the difference between two numbers or indicates the negative value of a numeric expression. |
& |
Forces string concatenation of two expressions. |
Abs |
Returns the absolute value of a number. |
Atn |
Returns the arctangent of a number. |
Cos |
Returns the cosine of an angle. |
Exp |
Returns e (the base of natural logarithms) raised to a power. |
Int |
Returns the integer portion of a number. |
Fix |
Returns the integer portion of a number. |
Log |
Returns the natural logarithm of a number. |
Rnd |
Returns a random number. |
Sgn |
Returns an integer indicating the sign of a number. |
Sin |
Returns the sine of an angle. |
Sqr |
Returns the square root of a number. |
Tan |
Returns the tangent of an angle. |
RhinoScript extents the math capabilities of VBScript by adding the following methods:
Method |
Description |
Returns the inverse cosine of a number. |
|
Returns the inverse hyperbolic cosine of a number. |
|
Measures the angle between two points. |
|
Measures the angle between two lines. |
|
Returns the inverse sine of a number. |
|
Returns the inverse hyperbolic sine of a number. |
|
Returns the angle from the X axis to a point (y,x). |
|
Returns the inverse hyperbolic tangent of a number. |
|
Returns the ceiling of a number. |
|
Returns the hyperbolic cosine of an angle. |
|
Returns the standard deviation from an array of numbers. |
|
Returns the distance between two points. |
|
Returns the value of the base of the natural system of logarithms (e). |
|
Returns the floor of a number. |
|
Returns the floating-point remainder. |
|
Calculates the hypotenuse. |
|
Returns the base 10 logarithm of a specified number. |
|
Returns the maximum number from an array of numbers. |
|
Returns the mean, or average, value from an array of numbers. |
|
Return the median value from an array of numbers. |
|
Returns the minimum number from an array of numbers. |
|
Returns the PI constant. |
|
Returns a point at an angle and distance from the point. |
|
Returns a random number. |
|
Returns the hyperbolic sine of an angle. |
|
Solves a quadratic equation. |
|
Returns the sum number from an array of numbers. |
|
Returns the hyperbolic tangent of an angle. |
|
Converts an angle in radians to degrees. |
|
Converts an angle in degrees to radians. |
Note, the following non-intrinsic math functions can be derived from the intrinsic math functions:
Function |
Derived Equivalent |
Secant |
Sec(X) = 1 / Cos(X) |
Cosecant |
Cosec(X) = 1 / Sin(X) |
Cotangent |
Cotan(X) = 1 / Tan(X) |
Inverse Sine |
Arcsin(X) = Atn(X / Sqr(-X * X + 1)) |
Inverse Cosine |
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1) |
Inverse Secant |
Arcsec(X) = Atn(X / Sqr(X * X - 1)) + Sgn((X) -1) * (2 * Atn(1)) |
Inverse Cosecant |
Arccosec(X) = Atn(X / Sqr(X * X - 1)) + (Sgn(X) - 1) * (2 * Atn(1)) |
Inverse Cotangent |
Arccotan(X) = Atn(X) + 2 * Atn(1) |
Hyperbolic Sine |
HSin(X) = (Exp(X) - Exp(-X)) / 2 |
Hyperbolic Cosine |
HCos(X) = (Exp(X) + Exp(-X)) / 2 |
Hyperbolic Tangent |
HTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) + Exp(-X)) |
Hyperbolic Secant |
HSec(X) = 2 / (Exp(X) + Exp(-X)) |
Hyperbolic Cosecant |
HCosec(X) = 2 / (Exp(X) - Exp(-X)) |
Hyperbolic Cotangent |
HCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) - Exp(-X)) |
Inverse Hyperbolic Sine |
HArcsin(X) = Log(X + Sqr(X * X + 1)) |
Inverse Hyperbolic Cosine |
HArccos(X) = Log(X + Sqr(X * X - 1)) |
Inverse Hyperbolic Tangent |
HArctan(X) = Log((1 + X) / (1 - X)) / 2 |
Inverse Hyperbolic Secant |
HArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X) |
Inverse Hyperbolic Cosecant |
HArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1) +1) / X) |
Inverse Hyperbolic Cotangent |
HArccotan(X) = Log((X + 1) / (X - 1)) / 2 |
Logarithm to base N |
LogN(X) = Log(X) / Log(N) |