---
title: "GLKMatrix4Subtract(_:_:)"
framework: GLKit
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, macOS 10.8+, tvOS 9.0+]
path: "glkit/glkmatrix4subtract(_:_:)"
---

# GLKMatrix4Subtract(_:_:)

Returns a new 4x4 matrix created by performing a component-wise subtraction of two matrices.

## Declaration

```swift
func GLKMatrix4Subtract(_ matrixLeft: GLKMatrix4, _ matrixRight: GLKMatrix4) -> GLKMatrix4
```

## Parameters

- `matrixLeft`: The starting matrix.
- `matrixRight`: The matrix to subtract.

## Return Value

Return Value A new matrix whose components each represent the difference between the components found in the same positions of the two source matrices.

## See Also

### Performing Mathematical Operations on Matrices

- [GLKMatrix4Invert(_:_:)](glkit/glkmatrix4invert(_:_:).md)
- [GLKMatrix4Transpose(_:)](glkit/glkmatrix4transpose(_:).md)
- [GLKMatrix4InvertAndTranspose(_:_:)](glkit/glkmatrix4invertandtranspose(_:_:).md)
- [GLKMatrix4Multiply(_:_:)](glkit/glkmatrix4multiply(_:_:).md)
- [GLKMatrix4Rotate(_:_:_:_:_:)](glkit/glkmatrix4rotate(_:_:_:_:_:).md)
- [GLKMatrix4RotateWithVector3(_:_:_:)](glkit/glkmatrix4rotatewithvector3(_:_:_:).md)
- [GLKMatrix4RotateWithVector4(_:_:_:)](glkit/glkmatrix4rotatewithvector4(_:_:_:).md)
- [GLKMatrix4RotateX(_:_:)](glkit/glkmatrix4rotatex(_:_:).md)
- [GLKMatrix4RotateY(_:_:)](glkit/glkmatrix4rotatey(_:_:).md)
- [GLKMatrix4RotateZ(_:_:)](glkit/glkmatrix4rotatez(_:_:).md)
- [GLKMatrix4Scale(_:_:_:_:)](glkit/glkmatrix4scale(_:_:_:_:).md)
- [GLKMatrix4ScaleWithVector3(_:_:)](glkit/glkmatrix4scalewithvector3(_:_:).md)
- [GLKMatrix4ScaleWithVector4(_:_:)](glkit/glkmatrix4scalewithvector4(_:_:).md)
- [GLKMatrix4Translate(_:_:_:_:)](glkit/glkmatrix4translate(_:_:_:_:).md)
- [GLKMatrix4TranslateWithVector3(_:_:)](glkit/glkmatrix4translatewithvector3(_:_:).md)
