# Geom

> Python API functions

### applyTransform

Apply a transformation matrix to a geometrical entity.

```python
geom.applyTransform(entity, matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])
```

Parameters

| Type                                  | Name   | Description                |
| ------------------------------------- | ------ | -------------------------- |
| [GeomEntity](./geom_types#geomentity) | entity | The geometric entity.      |
| [Matrix4](./geom_types#matrix4)       | matrix | The transformation matrix. |

### configureFunctionLogger

```python
geom.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
```

Parameters

| Type                            | Name                | Description |
| ------------------------------- | ------------------- | ----------- |
| [String](./core_types#string)   | functionName        |             |
| [Boolean](./core_types#boolean) | enableFunction      |             |
| [Boolean](./core_types#boolean) | enableParameters    |             |
| [Boolean](./core_types#boolean) | enableExecutionTime |             |

### getEntityAABB

Retrieve the Axis-Aligned Bounded Box of a geometric entity.

```python
geom.getEntityAABB(entity) -> geom.AABB
```

Parameters

| Type                                  | Name   | Description           |
| ------------------------------------- | ------ | --------------------- |
| [GeomEntity](./geom_types#geomentity) | entity | The geometric entity. |

Returns

| Type                      | Name | Description                   |
| ------------------------- | ---- | ----------------------------- |
| [AABB](./geom_types#aabb) | aabb | The axis aligned bounded box. |

## Math

### changeOfBasisMatrix

Construct a Change of Basis Matrix (e.g multiplying the point \[0,0,0] will result to the point origin).

```python
geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4
```

Parameters

| Type                            | Name   | Description              |
| ------------------------------- | ------ | ------------------------ |
| [Point3](./geom_types#point3)   | origin | Origin of the new basis. |
| [Vector3](./geom_types#vector3) | x      | X axis of the new basis. |
| [Vector3](./geom_types#vector3) | y      | Y axis of the new basis. |
| [Vector3](./geom_types#vector3) | z      | Z axis of the new basis. |

Returns

| Type                            | Name          | Description                 |
| ------------------------------- | ------------- | --------------------------- |
| [Matrix4](./geom_types#matrix4) | changeOfBasis | The change of basis matrix. |

See also:

* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### decomposeTransform

Decompose a Matrix4 into translation, scale and rotation through Quaternion.

```python
geom.decomposeTransform(matrix) -> geom.Vector3, geom.Quaternion, geom.Vector3
```

Parameters

| Type                            | Name   | Description |
| ------------------------------- | ------ | ----------- |
| [Matrix4](./geom_types#matrix4) | matrix |             |

Returns

| Type                                  | Name        | Description |
| ------------------------------------- | ----------- | ----------- |
| [Vector3](./geom_types#vector3)       | translation |             |
| [Quaternion](./geom_types#quaternion) | rotation    |             |
| [Vector3](./geom_types#vector3)       | scale       |             |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### fromAffine

Create a Matrix from an Affine.

```python
geom.fromAffine(affine) -> geom.Matrix4
```

Parameters

| Type                          | Name   | Description |
| ----------------------------- | ------ | ----------- |
| [Affine](./geom_types#affine) | affine | The affine. |

Returns

| Type                            | Name   | Description         |
| ------------------------------- | ------ | ------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The created Matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### fromLookAtMatrix

Get camera position, up and target vectors.

```python
geom.fromLookAtMatrix(matrix, distanceFromTarget=1) -> geom.Point3, geom.Vector3, geom.Point3
```

Parameters

| Type                              | Name               | Description         |
| --------------------------------- | ------------------ | ------------------- |
| [Matrix4](./geom_types#matrix4)   | matrix             | The created Matrix. |
| [Distance](./geom_types#distance) | distanceFromTarget |                     |

Returns

| Type                            | Name     | Description          |
| ------------------------------- | -------- | -------------------- |
| [Point3](./geom_types#point3)   | position | The camera position. |
| [Vector3](./geom_types#vector3) | up       | The up vector.       |
| [Point3](./geom_types#point3)   | target   | The target position. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### fromOriginNormal

Create a Matrix from an origin and a normal vector.

```python
geom.fromOriginNormal(origin, normal) -> geom.Matrix4
```

Parameters

| Type                            | Name   | Description        |
| ------------------------------- | ------ | ------------------ |
| [Point3](./geom_types#point3)   | origin | The origin point.  |
| [Vector3](./geom_types#vector3) | normal | The normal vector. |

Returns

| Type                            | Name   | Description         |
| ------------------------------- | ------ | ------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The created Matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### fromTRS

Create a Matrix from translation, rotation and scaling vectors.

```python
geom.fromTRS(T, R, S) -> geom.Matrix4
```

Parameters

| Type                            | Name | Description                    |
| ------------------------------- | ---- | ------------------------------ |
| [Vector3](./geom_types#vector3) | T    | The translation vector.        |
| [Vector3](./geom_types#vector3) | R    | The rotation vector (degrees). |
| [Vector3](./geom_types#vector3) | S    | The scaling vector.            |

Returns

| Type                            | Name   | Description         |
| ------------------------------- | ------ | ------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The created Matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### getMaxScale

Get maximum matrix scale.

```python
geom.getMaxScale(matrix) -> core.Double
```

Parameters

| Type                            | Name   | Description |
| ------------------------------- | ------ | ----------- |
| [Matrix4](./geom_types#matrix4) | matrix |             |

Returns

| Type                          | Name  | Description      |
| ----------------------------- | ----- | ---------------- |
| [Double](./core_types#double) | scale | Max scale value. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### invertMatrix

Invert a matrix.

```python
geom.invertMatrix(matrix=geom.IdentityMatrix4) -> geom.Matrix4
```

Parameters

| Type                            | Name   | Description           |
| ------------------------------- | ------ | --------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The matrix to invert. |

Returns

| Type                            | Name     | Description          |
| ------------------------------- | -------- | -------------------- |
| [Matrix4](./geom_types#matrix4) | inverted | The inverted matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### lookAtMatrix

Create a matrix from a camera position, up and target.

```python
geom.lookAtMatrix(position, up, target) -> geom.Matrix4
```

Parameters

| Type                            | Name     | Description          |
| ------------------------------- | -------- | -------------------- |
| [Point3](./geom_types#point3)   | position | The camera position. |
| [Vector3](./geom_types#vector3) | up       | The up vector.       |
| [Point3](./geom_types#point3)   | target   | The target position. |

Returns

| Type                            | Name   | Description         |
| ------------------------------- | ------ | ------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The created matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### matrixToQuaternion

Get the quaternion of a Matrix4.

```python
geom.matrixToQuaternion(matrix) -> geom.Quaternion
```

Parameters

| Type                            | Name   | Description |
| ------------------------------- | ------ | ----------- |
| [Matrix4](./geom_types#matrix4) | matrix |             |

Returns

| Type                                  | Name       | Description            |
| ------------------------------------- | ---------- | ---------------------- |
| [Quaternion](./geom_types#quaternion) | quaternion | The result quaternion. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### multiplyMatrices

Multiply two matrices, returns left\*right.

```python
geom.multiplyMatrices(left=geom.IdentityMatrix4, right=geom.IdentityMatrix4) -> geom.Matrix4
```

Parameters

| Type                            | Name  | Description        |
| ------------------------------- | ----- | ------------------ |
| [Matrix4](./geom_types#matrix4) | left  | Left side matrix.  |
| [Matrix4](./geom_types#matrix4) | right | Right side matrix. |

Returns

| Type                            | Name   | Description                            |
| ------------------------------- | ------ | -------------------------------------- |
| [Matrix4](./geom_types#matrix4) | result | Result of the matrices multiplication. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### multiplyMatrixPoint

Multiply a point by a matrix (i.e apply the matrix to a point).

```python
geom.multiplyMatrixPoint(matrix=geom.IdentityMatrix4, point) -> geom.Point3
```

Parameters

| Type                            | Name   | Description            |
| ------------------------------- | ------ | ---------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The matrix to apply.   |
| [Point3](./geom_types#point3)   | point  | The point to multiply. |

Returns

| Type                          | Name   | Description          |
| ----------------------------- | ------ | -------------------- |
| [Point3](./geom_types#point3) | result | The resulting point. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### multiplyMatrixVector

Multiply a vector by a matrix (i.e apply the matrix to a vector).

```python
geom.multiplyMatrixVector(matrix=geom.IdentityMatrix4, vector) -> geom.Vector3
```

Parameters

| Type                            | Name   | Description             |
| ------------------------------- | ------ | ----------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The matrix to apply.    |
| [Vector3](./geom_types#vector3) | vector | The vector to multiply. |

Returns

| Type                            | Name   | Description          |
| ------------------------------- | ------ | -------------------- |
| [Vector3](./geom_types#vector3) | result | The resulting point. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### orthographicMatrix

Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance.

```python
geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4
```

Parameters

| Type                              | Name             | Description                 |
| --------------------------------- | ---------------- | --------------------------- |
| [Double](./core_types#double)     | width3D          | The 3D width to consider.   |
| [Double](./core_types#double)     | height3D         | The 3D height to consider.  |
| [Distance](./geom_types#distance) | nearClipDistance | The near clipping distance. |
| [Distance](./geom_types#distance) | farClipDistance  | The far clipping distance.  |

Returns

| Type                            | Name   | Description         |
| ------------------------------- | ------ | ------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The created matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### perspectiveMatrix

Create a perspective matrix from a fovX, an aspect ratio, a near, and a far clipping distance.

```python
geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4
```

Parameters

| Type                              | Name             | Description                      |
| --------------------------------- | ---------------- | -------------------------------- |
| [Angle](./geom_types#angle)       | fovX             | The field of view on the x axis. |
| [Double](./core_types#double)     | aspectRatio      | The aspect ratio foxX/fovY.      |
| [Distance](./geom_types#distance) | nearClipDistance | The near clipping distance.      |
| [Distance](./geom_types#distance) | farClipDistance  | The far clipping distance.       |

Returns

| Type                            | Name   | Description         |
| ------------------------------- | ------ | ------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The created matrix. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)
* [geom.toTRS](./geom_functions#totrs)

### quaternionToMatrix

Returns the quaternion as a Matrix4.

```python
geom.quaternionToMatrix(quaternion) -> geom.Matrix4
```

Parameters

| Type                                  | Name       | Description |
| ------------------------------------- | ---------- | ----------- |
| [Quaternion](./geom_types#quaternion) | quaternion |             |

Returns

| Type                            | Name   | Description |
| ------------------------------- | ------ | ----------- |
| [Matrix4](./geom_types#matrix4) | matrix |             |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.toTRS](./geom_functions#totrs)

### toTRS

Decompose a Matrix into translation, rotation and scaling vectors.

```python
geom.toTRS(matrix=geom.IdentityMatrix4) -> geom.Vector3List
```

Parameters

| Type                            | Name   | Description                  |
| ------------------------------- | ------ | ---------------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | The Matrix to be decomposed. |

Returns

| Type                                    | Name | Description   |
| --------------------------------------- | ---- | ------------- |
| [Vector3List](./geom_types#vector3list) | TRS  | The TRS list. |

See also:

* [geom.changeOfBasisMatrix](./geom_functions#changeofbasismatrix)
* [geom.decomposeTransform](./geom_functions#decomposetransform)
* [geom.fromAffine](./geom_functions#fromaffine)
* [geom.fromLookAtMatrix](./geom_functions#fromlookatmatrix)
* [geom.fromOriginNormal](./geom_functions#fromoriginnormal)
* [geom.fromTRS](./geom_functions#fromtrs)
* [geom.getMaxScale](./geom_functions#getmaxscale)
* [geom.invertMatrix](./geom_functions#invertmatrix)
* [geom.lookAtMatrix](./geom_functions#lookatmatrix)
* [geom.matrixToQuaternion](./geom_functions#matrixtoquaternion)
* [geom.multiplyMatrices](./geom_functions#multiplymatrices)
* [geom.multiplyMatrixPoint](./geom_functions#multiplymatrixpoint)
* [geom.multiplyMatrixVector](./geom_functions#multiplymatrixvector)
* [geom.orthographicMatrix](./geom_functions#orthographicmatrix)
* [geom.perspectiveMatrix](./geom_functions#perspectivematrix)
* [geom.quaternionToMatrix](./geom_functions#quaterniontomatrix)

## debug
