Abs (Absolute Value)
Syntax: Abs(x)
Purpose:
Returns the absolute value (the distance from zero) of a number x
.
Ignores whether the number is positive or negative.
Example:
a = _Abs(
-153
)
-- Sets a to 153
Acos (Arccosine)
Syntax: Acos(x)
Purpose:
Returns the arccosine of x
in radians. The arccosine is the inverse function of cosine, meaning
it finds the angle whose cosine is x
.
The result will be between 0 and pi.
Example:
x = _Acos(
1
)
-- result will be 0 (cosine of 0 radians is 1)
y = _Acos(
-1
)
-- result will be approximately 3.14159 (cosine of pi radians is -1)
Angle_Between_Two_Points
Syntax: Angle_Between_Two_Points(From_X, From_Y, To_X, To_Y)
Purpose:
Calculates the angle (in radians) formed by a line drawn between two
points. Uses the starting point (From_X
,
From_Y
)
as the angle's vertex.
Any_pow (Exponentiation)
Syntax: Any_pow(x, y)
Purpose:
Calculates x
raised to the power of y
(x^y). Can also be done using the ^
operator, like x^y
.
Any_root (Roots)
Syntax: Any_root(x, y)
Purpose:
Returns x
raised to the power of (1/y
).
In other words, finds the y
-th
root of x
.
Can also be done using the ^
operator, like x^(1/y)
.
Asin (Arcsine)
Syntax: Asin(x)
Purpose:
Returns the arcsine of x
in radians. Arcsine is the inverse function of sine, finding the
angle whose sine is x
.
The result will be between -pi/2 and pi/2.
Example:
_Print_Console(_Asin(
1
))
-- result will be approx. 1.57079 (sine of pi/2 radians is 1)
_Print_Console(_Asin(
-1
))
-- result will be approx. -1.57079 (sine of -pi/2 radians is -1)
Atan (Arctangent)
Syntax: Atan(x)
Purpose:
Returns the arctangent of x
in radians. Arctangent is the inverse function of tangent, finding
the angle whose tangent is x
.
The result will be between -pi/2 and pi/2.
Example:
_Print_Console(_Atan(
0
))
-- result is 0 (tangent of 0 radians is 0)
Atan2 (Arctangent with Quadrant Handling)
Syntax: Atan2(y, x)
Purpose:
Similar to Atan
,
but considers the signs of x
and y
to determine the correct quadrant of the result. Useful because Atan
alone doesn't fully distinguish between some angles. Result will be
in the range of -pi to pi radians.
Example:
_Print_Console(_Atan2(
1
,
0
))
-- Result will be pi/2
Bin (Binary Conversion)
Syntax: Bin(num)
Purpose: Converts a decimal (base-10) number to its binary (base-2) representation.
Bin_to_Dec (Binary to Decimal)
Syntax: Bin_to_Dec(binNumber)
Purpose: Converts a binary number (as a string) to its equivalent decimal form.
Ceil (Ceiling)
Syntax: Ceil(x)
Purpose:
Returns the smallest integer that is greater than or equal to x
.
Example:
_Print_Console( _Ceil(
0.5
) )
-- Output: 1
_Print_Console( _Ceil(
-0.5
) )
-- Output: 0
Center_Between_Two_Points
Syntax: Center_Between_Two_Points(x1, y1, x2, y2)
Purpose:
Calculates the midpoint (the point exactly in between) of a line
segment defined by the coordinates (x1
,
y1
)
and (x2
,
y2
).
Combination
Syntax: Combination(n, r)
Purpose:
Calculates the number of ways you can choose a subset of r
items from a larger set of n
items (where order doesn't matter).
Convert_from_any_base
Syntax: Convert_from_any_base(number_as_string, nn)
Purpose:
Takes a number represented as a string in any base (nn
,
from 2 to 54) and converts it to its equivalent decimal (base-10)
representation.
Example:
_Print_Console( _Convert_from_any_base(
"11111111"
,
2
) )
-- Output: 255 (binary to decimal)
Convert_to_any_base
Syntax: Convert_to_any_base(number, nn)
Purpose:
Converts a decimal number into its representation in another base
(nn
,
from 2 to 54).
Example:
_Print_Console( _Convert_to_any_base(
255
,
2
) )
-- Output: 11111111 (decimal to binary)
Cos (Cosine)
Syntax: Cos(x)
Purpose:
Returns the cosine of an angle x
(given in radians).
Cosh (Hyperbolic Cosine)
Syntax: Cosh(x)
Purpose:
Returns the hyperbolic cosine of x
.
Hyperbolic functions are related to hyperbolas the way trigonometric
functions (like cosine) are related to circles.
Cubic_root
Syntax: Cubic_root(x)
Purpose:
Finds the cube root of x
(equivalent to x^(1/3)
).
DMS (Degrees, Minutes, Seconds Conversion)
Syntax: DMS(g)
Purpose: Converts an angle given in decimal degrees into its equivalent representation using degrees, minutes, and seconds.
Decrement
Syntax: Decrement(Object_Name, Decrement_Value, Minimum_Value)
Purpose:
Decreases the value stored in Object_Name
by Decrement_Value
.
Ensures the value doesn't go below Minimum_Value
.
Likely designed for use with GUI objects within your program.
Deg (Degrees to Radians)
Syntax: Deg(x)
Purpose:
Converts an angle x
from degrees to radians.
Example:
_Print_Console(_Deg(
180
))
-- Output: 3.14159... (pi)
Distance_Between_Two_Points
Syntax: Distance_Between_Two_Points (x1, y1, x2, y2)
Purpose:
Calculates the straight-line distance between two points with
coordinates (x1
,
y1
)
and (x2
,
y2
).
Exp (Natural Exponent)
Syntax: Exp(x)
Purpose:
Returns the value of e
(the mathematical constant approximately 2.718) raised to the power
of x
.
Example:
_Print_Console(_Exp(
0
))
-- Output: 1
_Print_Console(_Exp(
1
))
-- Output: approx. 2.71828
Factorial
Syntax: Factorial(x)
Purpose:
Calculates the factorial of a non-negative integer x
.
Factorial is the product of all positive integers less than or equal
to x
(e.g., 5! = 5 * 4 * 3 * 2 * 1 = 120).
Floor
Syntax: Floor(x)
Purpose:
Returns the largest integer that is less than or equal to x
.
Example:
_Print_Console( _Floor(
0.5
) )
-- Output: 0
_Print_Console( _Floor(
-0.5
) )
-- Output: -1
Fmod (Floating-Point Modulus)
Syntax: Fmod(x, y)
Purpose:
Returns the remainder after dividing x
by y
,
with special handling to ensure an accurate result even when dealing
with floating-point numbers (numbers with decimals).
Frac (Fractional Part)
Syntax: Frac(nValue)
Purpose: Returns just the decimal portion of a number.
Example:
_Print_Console(_Frac(
3.14159
))
-- Output: 0.14159
Frexp (Fraction and Exponent Split)
Syntax: Frexp(x)
Purpose:
Splits a number x
into two parts: a normalized fraction (m
)
and an exponent (e
).
The fraction m
will always be between 0.5 and 1, and the result follows the formula
x
= m * 2^e
.
Example:
fraction, exponent = _Frexp(
128
)
_Print_Console(fraction)
-- Output: 0.5
_Print_Console(exponent)
-- Output: 8
Hex (Hexadecimal Conversion)
Syntax: Hex(number)
Purpose: Converts a decimal (base-10) number to its hexadecimal (base-16) representation.
Hex_to_Dec (Hexadecimal to Decimal)
Syntax: Hex_to_Dec(hexNumber)
Purpose: Converts a hexadecimal number (as a string) to its equivalent decimal form.
Hyp_Cos (Hyperbolic Cosine)
Syntax: Hyp_Cos(x)
Purpose:
Returns the hyperbolic cosine of x
.
For a deeper explanation, see the Cosh
function.
Hyp_Sin (Hyperbolic Sine)
Syntax: Hyp_Sin(x)
Purpose:
Returns the hyperbolic sine of x
.
See the Cosh
function for more context.
Hyp_Tan (Hyperbolic Tangent)
Syntax: Hyp_Tan(x)
Purpose:
Returns the hyperbolic tangent of x
.
See the Cosh
function for more context.
Increment
Syntax: Increment(Object_Name, Increment_Value)
Purpose:
Increases the value stored in Object_Name
by Increment_Value
.
Likely designed for use with GUI objects within your program.
Int (Truncation)
Syntax: Int(n)
Purpose:
Essentially the same as Floor
.
Returns the integer part of n
by removing any decimals.
Is_Bin (Binary Number Check)
Syntax: Is_Bin(string)
Purpose:
Returns true
if the provided string
contains a valid binary number, and false
otherwise.
Is_Hex (Hexadecimal Number Check)
Syntax: Is_Hex(string)
Purpose:
Returns true
if the provided string
contains a valid hexadecimal number, and false
otherwise.
Is_Number
Syntax: Is_Number(test_number)
Purpose:
Returns true
if the provided test_number
is a valid numerical value, and false
otherwise.
Is_Oct (Octal Number Check)
Syntax: Is_Oct(string)
Purpose:
Returns true
if the provided string
contains a valid octal number (base-8) and false
otherwise.
Is_Range
Syntax: Is_Range(n, Initial_Range, Final_Range)
Purpose:
Returns true
if the number n
falls within the inclusive range between Initial_Range
and Final_Range
,
and false
otherwise.
Ldexp (Combine Fraction and Exponent)
Syntax: Ldexp(m, e)
Purpose:
The opposite of Frexp
.
Combines a fraction m
(between 0.5 and 1) and an exponent e
and returns the result according to the formula x
= m * 2^e
.
Ln (Natural Logarithm)
Syntax: Ln(x)
Purpose:
Returns the natural logarithm (base-e logarithm) of x
.
Log (Natural Logarithm - Alias)
Syntax: Log(x)
Purpose:
Exactly the same as Ln(x)
.
Returns the natural logarithm (base-e logarithm) of x
.
Log10 (Base-10 Logarithm)
Syntax: Log10(x)
Purpose:
Returns the base-10 logarithm of x
.
Minus (Negation)
Syntax: Minus(x)
Purpose:
Returns the negative of x
(equivalent to x
* -1
).
Mod (Modulus)
Syntax: Mod(x, y)
Purpose:
Calculates the modulus, which is the remainder after division of x
by y
.
Modf (Split into Integer and Fraction)
Syntax: Modf(x)
Purpose:
Splits a number x
into two parts: its integer portion and its fractional portion.
Example:
integerPart, fractionalPart = _Modf(
5.3
)
_Print_Console(integerPart)
-- Output: 5
_Print_Console(fractionalPart)
-- Output: 0.3
Oct (Octal Conversion)
Syntax: Oct(number)
Purpose: Converts a decimal (base-10) number to its octal (base-8) representation.
Oct_to_Dec (Octal to Decimal)
Syntax: Oct_to_Dec(octNumber)
Purpose: Converts an octal number (as a string) to its equivalent decimal form.
Permutation
Syntax: Permutation(n, r)
Purpose:
Calculates the number of ways you can order r
items out of a set of n
items (where order matters).
Pi
Syntax: Pi()
Purpose: Returns the mathematical constant pi (approximately 3.14159).
Point_In_Polygon
Syntax: Point_In_Polygon(x, y, polygon)
Purpose:
Determines whether a point with coordinates (x
,
y
)
lies inside a polygon defined by an array of points named polygon
.
Useful for geographic applications!
Pow (Exponentiation - Alias)
Syntax: Pow(x, y)
Purpose:
Exactly the same as Any_pow(x,
y)
.
Calculates x
to the power of y
.
Pow_minus_one (Reciprocal)
Syntax: Pow_minus_one(x)
Purpose:
Calculates the reciprocal of x
(equivalent to 1/x
or x^(-1)
).
Pow_three (Cubing)
Syntax: Pow_three(x)
Purpose:
Calculates x
to the power of 3 (equivalent to x^3
).
Rad (Radians to Degrees)
Syntax: Rad(x)
Purpose:
The opposite of Deg
.
Converts an angle x
from radians to degrees.
RandomSeed
Syntax: RandomSeed(x)
Purpose: Sets the starting point ("seed") for the pseudo-random number generator. Using the same seed repeatedly will produce the same sequence of random numbers, which can be useful for testing.
Rnd (Random Number between 0 and 1)
Syntax: Rnd()
Purpose: Returns a pseudo-random decimal number between 0 (inclusive) and 1 (exclusive).
Rnd_Between (Random Number within Range)
Syntax: Rnd_Between(r1, r2)
Purpose:
Returns a pseudo-random number between r1
and r2
(inclusive).
Round
Syntax: Round(x)
Purpose:
Rounds a number x
to the nearest integer. For numbers with a fractional part exactly
equal to 0.5, it rounds up.
Sin (Sine)
Syntax: Sin(x)
Purpose:
Returns the sine of an angle x
(given in radians).
Sinh (Hyperbolic Sine)
Syntax: Sinh(x)
Purpose:
Returns the hyperbolic sine of x
.
See the Cosh
function for more context.
Sqrt (Square Root)
Syntax: Sqrt(x)
Purpose:
Calculates the principal square root of x
(the non-negative root).
Tan (Tangent)
Syntax: Tan(x)
Purpose:
Returns the tangent of an angle x
(given in radians).
Tanh (Hyperbolic Tangent)
Syntax: Tanh(x)
Purpose:
Returns the hyperbolic tangent of x
.
See the Cosh
function for more context.
Val (String to Number)
Syntax: Val(string)
Purpose: Converts a string representation of a number into its numerical equivalent.
aCos, aSin, aTan, pi
These
appear to be alternative names or potential typos. They likely
function the same as Acos
,
Asin
,
Atan
,
and Pi
respectively.