# SUBSYSTEM OVERVIEW

Math (MTH) Subsystem

The MTH subsystem provides functions for the manipulation of vectors, matrices, etc.

# VECTOR FUNCTIONS

The vector functions performs basic operation on vector data types. Most of the functions can work on vectors of any dimensionality. The following functions are available:

mth_AddVector Adds two vectors mth_CrossVector Computes cross product of two vectors mth_DivideVector Divides a vector by a scalar mth_DotVector Computes dot product of two vectors mth_GetVectorMag Computes magnitude of a vector mth_MakeVector Generates a vector from two points mth_MutiplyVector Multiplies a vector and a scalar mth_RotateVector2D Rotates a 2D vector mth_SubtractVector Subtract a vector from another vector mth_UnitizeVector Unitizes a vector

See the manual pages for the full bindings.

# GENERAL FUNCTIONS

These are general purpose math functions. The following functions are available:

mth_AveragePoints

Find the average point of a set of points

mth_CosineTwoVectors

Compute the cosine of the angle between two vectors.

mth_CheckColin

Check if three points are colinear

mth_CheckCoinPoint

Check for the coincidence of two points

mth_CheckCoinPointsTol

Check for the coincidence of two points using tolerance

mth_CheckDirColin

Check if three points are directionally colinear

mth_CompareDouble

Check two double arrays for equality

mth_FindMinMaxCoord

Find the minimium and maximium coordinate values

mth_FindActiveRanges

Find active ranges of MinMax boxes in a specified dimension

mth_FindTwoPerpAxesToAxis

Find two perpendicular vectors (unit) to a unit vector

mth_Get2DArea

Get the area of a 2D point set assuming counterclockwise orientation

mth_GetAngle2DPoint

Get the angle between X axis and the line through a point and the origin

mth_GetAngleSinCos

Calculate and round sin and cos of an angle

mth_GetAtan2

Compute adjusted angle of a specified point

mth_GetAxisMatrix

Get a 3X3 rotation matrix defined by an axis and the angle or rotation about the axis

mth_GetDistance

Compute distance between two points

mth_GetFactorial

Determine the factorial of a number

mth_GetIdentMatrix

Build a nXm identity matrix

mth_GetLineStringInter2D

Find all of the 2D intersections between a specified line segment and a set of linear strings

mth_GetPlanePntMatrix

Get the matrix for a plane defined by three points

mth_GetPntPlaneMatrix

Get a 3X3 rotation matrix for a three point plane

mth_GetRotMatrixFromPlaneNorm

Get a 3X3 rotation matrix defined by the normal to plane

mth_GetRotMatrixFromPnts

Get the 3X3 rotation matrix defined by the plane of the points

mth_GetSign

Get the sign of a value

mth_GetVectorRadPoint

Get the radius and the projected point from the projection of a point to a vector through a point

mth_GetSquaredDistance

Compute squared distance between two points

mth_HorizontalLineLoopIntersect

Find the intersection points between a horizontal line and a loop

mth_InsertPoint2D

Insert a 2D point into an array of points after pntno location

mth_Intersect2DLines

Intersect two parametric lines in the xy-plane

mth_InterSect3DLines

Intersect two 3 space lines

mth_LeastSquaresLine2D

Compute the least squares line through a set of 2D points

mth_LoopInnerOuter

Check for the relation of two non-intersecting loops

mth_MatrixGlobalToLocalSys

Find the transformation matrix from the global to a local system

mth_MatrixInverse

Find the inverse of a square matrix

mth_MatrixLocalToGlobalSys

Find the transformation matrix from a local to the global system

mth_MatrixProduct

Find the product of two matrices

mth_MatrixRotateAboutAxis

Find the transformation matrix for a rotation about an axis

mth_MatrixTranslateAlongAxis

Find the transformation matrix for a translation along an axis

mth_MatrixTranspose

Find the transpose of a matrix

mth_OffsetPointAlongAxis

Translate a 3D point along a specified direction

mth_PointInLoop

Determine if a 2D point is outside, on, or inside a loop of 2D points

mth_PointInPlane

Find least squares plane of points and test points for planarity

mth_PointIn3PtPlane

Check if a points is in a plane defined by three points

mth_PointsCollinear

Check if a set of points all line on a straight line

mth_PointToPlane

Find the projection of a point to a plane

mth_PointToLine

Find the projection of a 3D point to a 3D line

mth_PointToLine2D

Find the projection of a 2D point to a 2D line

mth_PointToLineDistProjParm

Find the projection of a point to a line

mth_SolveTwoLinearEqs

Solve two linear equations in two unknowns

mth_SortInteger

Sort an array of integer values in ascending/descending order

mth_SortDouble

Sort an array of double values in ascending/descending order

mth_SortDoubleArrayByBubble

Sort a 2-D double array with a 1-D integer array

mth_SweepAnglesContPoints

Find the sweeping angles of a set of continuous points on XY plane

mth_SweepAnglesMerge

Merge sweeping angles

mth_SweepAnglesLoop

Find the sweeping angles of a closed loop

mth_TransformPoint

Transform a 3D point through a matrix

mth_TransformVector

Transform a 3D vector through a matrix

mth_VerticalLineLoopIntersect

Find the intersection points between a vertical line and a loop

See the manual pages for the full bindings.