>> Mathematics
____________________________

All angles are in radians.

ABS(x)- Absolute value of x
COS(x)- Cosine of x
SIN(x)- Sine of x
TAN(x)- Tangent of x
ACOS(x)- Arc cosine of x
ASIN(x)- Arc sine of x
ATN(x) or ATAN(x)- Arc tangent of x
ATAN2(x,y)- Arc tangent of two variables

Hyperbolic functions:

COSH(x), SINH(x), TANH(x)
ACOSH(x), ASINH(x), ATANH(x)

EXP(x)- the value of e raised to the power of x
LOG(x)- natural logarithm of x
LOG10(x)- the base-10 logarithm of x

POW(x,y)- x raised to power of y
SQR(x)- square root of x

INT(x)- rounds x downwards to the nearest integer
FIX(x)- rounds x upwards to the nearest integer
FLOOR(x)- largest integer value not greater than x
CEIL(x)- smallest integral value not less than x
FRAC(x)- fractional part of x

ROUND(x[,decs])- rounds the x to the nearest integer or number
with 'decs' decimal digits.

SGN(x)- sign of x (+1 for positive,-1 for negative
and 0 for zero)

DEG(x)- radians to degrees
RAD(x)- degrees to radians
____________________________

MAX(...), MIN(...)
ABSMIN(...), ABSMAX(...)

Maximum/Minimum value of parameters. Parameters can be anything
(arrays, ints, reals, strings).

ABSMIN/ABSMAX returns the absolute min/max value.

Example:
? MAX(3,4,8)
? MIN(array(),2,3)
? MAX("abc","def")
____________________________

SUM(...)- Sum of value

SUMSQ(...)- Sum of square value

STATMEAN(...)- Arithmetical mean

STATMEANDEV(...)- Mean deviation

STATSPREADS(...)- Sample spread

STATSPREADP(...)- Population spread

Notes:
Sample standard deviation: SQR(STATSPREADS(array))
Population standard deviation: SQR(STATSPREADP(array))
____________________________

LINEQN(A, B [, toler])

Returns an array with the values of the unknowns.
This function solves equations by using the Gauss-Jordan method.

A = equations
B = results
toler = tolerance number
(the absolute value of the lowest acceptable number)
default = 0 = none

|x|<= toler : x = 0

Note: The result is a matrix Nx1. For the SB that array is
two-dimension array.
____________________________

INVERSE(A)

returns the inverse matrix of A.
____________________________

DETERM(A[, toler])

Determinant of A

toler = tolerance number
(the absolute value of the lowest acceptable number)
default = 0 = none

|x|<= toler : x = 0
____________________________

ROOT low, high, segs, maxerr, BYREF result, BYREF errcode USE expr
____________________________

DERIV x, maxtries, maxerr, BYREF result, BYREF errcode USE expr
____________________________

DIFFEQN x0, y0, xf, maxseg, maxerr, BYREF yf, BYREF er USE expr

Runge-Kutta method

____________________________

>> 2D Algebra
____________________________

SEGCOS(Ax,Ay,Bx,By,Cx,Cy,Dx,Dy)
SEGSIN(Ax,Ay,Bx,By,Cx,Cy,Dx,Dy)

Sinus or cosine of 2 line segments (A->B, C->D).
____________________________

PTDISTSEG(Bx,By,Cx,Cy,Ax,Ay)

Distance of point A from line segment B-C

PTDISTLN(Bx,By,Cx,Cy,Ax,Ay)

Distance of point A from line B, C
____________________________

PTSIGN(Ax,Ay,Bx,By,Qx,Qy)

The sign of point Q from line segment A->B
____________________________

SEGLEN(Ax,Ay,Bx,By)

Length of line segment
____________________________

POLYAREA(poly)

Area of polyline
____________________________

POLYEXT poly(), BYREF xmin, BYREF ymin, BYREF xmax, BYREF ymax

Returns the polyline's extents
____________________________

INTERSECT Ax, Ay, Bx, By,
Cx, Cy, Dx, Dy,
BYREF type, BYREF Rx, BYREF Ry

Calculates the intersection of the two line segments A-B and C-D

Returns:
Rx,Ry = cross

type = cross-type
0 = No cross (R = external cross)
1 = One cross
2 = Parallel
3 = Parallel (many crosses)
4 = The cross is one of the line segments edges.
____________________________

2D: 3x3 Matrices

M3IDENT BYREF m3x3

M3ROTATE BYREF m3x3, angle, x, y

M3SCALE BYREF m3x3, x, y, fx, fy

M3TRANS BYREF m3x3, x, y

M3APPLY m3x3, BYREF poly

Example:

DIM poly(24)
DIM M(2,2)
...

M3IDENT M
M3ROTATE M, pi/2, 0, 0
M3SCALE M, 0, 0, 1.24, 1.24

' Draw the original polyline
DRAWPOLY poly

' Draw the polyline
' rotated by pi/2 from 0,0 and scaled by 1.24
M3APPLY M, poly
DRAWPOLY poly

____________________________

