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

# viewMatrix(viewRotationAngle:)

Returns the view matrix for the camera with a given view angle.

```
func viewMatrix(viewRotationAngle: CGFloat) -> simd_float4x4
```

## Parameters

`viewRotationAngle`

The view rotation angle, in degrees, that will be used to render the camera’s view.

## Return Value

The view matrix for the given view angle.

## Discussion

The view matrix can be used to transform geometry from world space into camera space for a given view angle.

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)