<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AffineTransform/rotate(byDegrees:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation15AffineTransformV6rotate9byDegreesy04CoreA07CGFloatV_tF"
  },
  "title" : "rotate(byDegrees:)"
}
-->

# rotate(byDegrees:)

Mutates an affine transformation matrix to apply a rotation.

```
mutating func rotate(byDegrees angle: CGFloat)
```

## Parameters

`angle`

The rotation angle in degrees.

## Discussion

The matrix takes the following form:

```swift
[  cos α   sin α  0 ]
[ -sin α   cos α  0 ]
[    0       0    1 ]
```

---

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)