---
title: invert()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsaffinetransform/invert()
---

# invert()

Replaces the receiver’s matrix with its inverse matrix.

## Declaration

```swift
func invert()
```

## Discussion

Discussion Inverse matrices are useful for undoing the effects of a matrix. If a previous point (x,y) was transformed to (x’,y’), inverting the matrix and applying it to point (x’,y’) yields the point (x,y). You can also use inverse matrices in conjunction with the concat() method to remove the effects of concatenating the matrix to the current transformation matrix of the current graphic context.

## See Also

### Accumulating Transformations

- [rotate(byDegrees:)](foundation/nsaffinetransform/rotate(bydegrees:).md)
- [rotate(byRadians:)](foundation/nsaffinetransform/rotate(byradians:).md)
- [scale(by:)](foundation/nsaffinetransform/scale(by:).md)
- [scaleX(by:yBy:)](foundation/nsaffinetransform/scalex(by:yby:).md)
- [translateX(by:yBy:)](foundation/nsaffinetransform/translatex(by:yby:).md)
- [append(_:)](foundation/nsaffinetransform/append(_:).md)
- [prepend(_:)](foundation/nsaffinetransform/prepend(_:).md)
