<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ARKit",
  "identifier" : "/documentation/ARKit/ARFrame/displayTransform(viewRotationAngle:viewportSize:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ARKit"
    ],
    "preciseIdentifier" : "c:objc(cs)ARFrame(im)displayTransformForViewRotationAngle:viewportSize:"
  },
  "title" : "displayTransform(viewRotationAngle:viewportSize:)"
}
-->

# displayTransform(viewRotationAngle:viewportSize:)

Returns a display transform for the provided viewport size and view angle.

```
func displayTransform(viewRotationAngle: CGFloat, viewportSize: CGSize) -> CGAffineTransform
```

## Parameters

`viewRotationAngle`

The view rotation angle, in degrees, of the viewport.

`viewportSize`

The size of the viewport.

## Return Value

The display transform matrix.

## Discussion

The display transform can be used to convert normalized points in the image-space coordinate system
of the captured image to normalized points in the view’s coordinate space. The transform provides the correct rotation
and aspect-fill for presenting the captured image in the given view angle and size.

The view angle, in degrees, is the clockwise rotation needed to keep the camera image level with the horizon
(`0` LandscapeRight, `90` Portrait, `180` LandscapeLeft, `270` PortraitUpsideDown). Obtain it from
`ARSession.viewRotationAngle`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)