EQWatcher Evolution > Scripting  > Math Functions

Many math functions are handled by simple operators -- addition, subtraction, multiplication, division, remainder, are all found in the statements section.

List of commands

abs, angle, cos, random, sin, sqrt, tan

The "abs" Command

This command converts a number to positive if it is negative.

Syntax:

abs([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns the absolute value of Data.

The "angle" Command

Gives the angle in degrees, 0 to 89, based on expression being the Tangent*100 of this angle.

The calculation is done by using a min point and max point (0 and 90), and comparing the desired result to the tangent midpoint of the min and max.  Basically this means that if expression is equal to Tan(45)*100 the angle is computed in a single cycle of the loop.  If the expression is equal to Tan(60)*100, the angle is computed by checking 45, then (max-min/2)+min... then since 60>mid, min is set to mid (if 60<mid, max is set to mid), and repeats.  This is fairly fast and efficient for this purpose.

Syntax:

angle([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns the angle in degrees, based on Data being the Tangent of this angle, multiplied by 100.

The "cos" Command

This command returns a cosine.

Syntax:

cos([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns the cosine of Data.

The "random" Command

This command returns a random number, between 0 and n-1.

Syntax:

random([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns a random number between 0 and Data-1.

The "sin" Command

This command returns a sine.

Syntax:

sin([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns the sine of Data.

The "sqrt" Command

This command returns a square root.

Syntax:

sqrt([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns the square root of Data.

The "tan" Command

This command returns a tangent.

Syntax:

tan([Data])

Data: Any valid expression that evaluates to an integer.

Return Value:

This command returns the tangent of Data.