# Synopsis

PDX_MSGT mth_MatrixGlobalToLocalSys(long option, MTH_3DVEC x_vec, MTH_3DVEC y_vec, MTH_3DVEC z_vec, MTH_3DPNT origin, double *matrix)

# Purpose

Find the transformation matrix from the global to a local system

# Description

Find the transformation matrix from the global to a local coordinate system. The local system is represented by three vectors that should follow the right hand rule, and a point that is the origin. The vectors do not have to be unit ones.

The matrix can be used to transform any object in the global coordinate system into the local system.

The matrix can be in either Homogeneous format (4x4) or GDX_MATRIX format (3x4) by choosing different option.

# Input

## option

### MTH_HOMOGENEOUS

The matrix will be in Homogeneous format (4x4); otherwise, in GDX_MATRIX format (3x4).

## x_vec

The vector of x axis

## y_vec

The vector of y axis

## z_vec

The vector of z axis

## origin

The origin of the local coordinate system

# Output

## matrix

The transformation matrix [12 or 16]

# Return

          MTH_NOERR
          Low level error return
          .fi