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

# GLKMatrix4Invert(_:_:)

Returns the inverse of a matrix.

## Declaration

```swift
func GLKMatrix4Invert(_ matrix: GLKMatrix4, _ isInvertible: UnsafeMutablePointer<Bool>?) -> GLKMatrix4
```

## Parameters

- `matrix`: A 4x4 matrix.
- `isInvertible`: On return, this holds doc://com.apple.documentation/documentation/Swift/true if the matrix was inverted or doc://com.apple.documentation/documentation/Swift/false if the matrix is not invertible.

## Return Value

Return Value If isInvertible was set to true, this holds an inverted matrix. Otherwise, the identity matrix is returned.

## See Also

### Performing Mathematical Operations on Matrices

- [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)
- [GLKMatrix4TranslateWithVector4(_:_:)](glkit/glkmatrix4translatewithvector4(_:_:).md)
