---
title: "CGAffineTransformInvert(_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgaffinetransforminvert(_:)"
---

# CGAffineTransformInvert(_:)

Returns an affine transformation matrix constructed by inverting an existing affine transform.

## Declaration

```swift
func CGAffineTransformInvert(_ t: CGAffineTransform) -> CGAffineTransform
```

## Parameters

- `t`: An existing affine transform.

## Return Value

Return Value A new affine transformation matrix. If the affine transform passed in parameter t cannot be inverted, the affine transform is returned unchanged.

## Discussion

Discussion Inversion is generally used to provide reverse transformation of points within transformed objects. Given the coordinates (x,y), which have been transformed by a given matrix to new coordinates (x’,y’), transforming the coordinates (x’,y’) by the inverse matrix produces the original coordinates (x,y).

## See Also

### Modifying Affine Transformations

- [CGAffineTransformTranslate(_:_:_:)](coregraphics/cgaffinetransformtranslate(_:_:_:).md)
- [CGAffineTransformScale(_:_:_:)](coregraphics/cgaffinetransformscale(_:_:_:).md)
- [CGAffineTransformRotate(_:_:)](coregraphics/cgaffinetransformrotate(_:_:).md)
- [CGAffineTransformConcat(_:_:)](coregraphics/cgaffinetransformconcat(_:_:).md)
