---
title: "GLKMatrixStackRotate(_:_:_:_:_:)"
framework: GLKit
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, macOS 10.8+, tvOS 9.0+]
path: "glkit/glkmatrixstackrotate(_:_:_:_:_:)"
---

# GLKMatrixStackRotate(_:_:_:_:_:)

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

## Declaration

```swift
func GLKMatrixStackRotate(_ stack: GLKMatrixStack, _ radians: Float, _ x: Float, _ y: Float, _ z: Float)
```

## Parameters

- `stack`: A matrix stack.
- `radians`: The angle of the rotation (a positive angle is counterclockwise).
- `x`: The x coordinate of the rotation axis.
- `y`: The y coordinate of the rotation axis.
- `z`: The z coordinate of the rotation axis.

## See Also

### Functions

- [GLKMatrixStackCreate(_:)](glkit/glkmatrixstackcreate(_:).md)
- [GLKMatrixStackGetMatrix2(_:)](glkit/glkmatrixstackgetmatrix2(_:).md)
- [GLKMatrixStackGetMatrix3(_:)](glkit/glkmatrixstackgetmatrix3(_:).md)
- [GLKMatrixStackGetMatrix3Inverse(_:)](glkit/glkmatrixstackgetmatrix3inverse(_:).md)
- [GLKMatrixStackGetMatrix3InverseTranspose(_:)](glkit/glkmatrixstackgetmatrix3inversetranspose(_:).md)
- [GLKMatrixStackGetMatrix4(_:)](glkit/glkmatrixstackgetmatrix4(_:).md)
- [GLKMatrixStackGetMatrix4Inverse(_:)](glkit/glkmatrixstackgetmatrix4inverse(_:).md)
- [GLKMatrixStackGetMatrix4InverseTranspose(_:)](glkit/glkmatrixstackgetmatrix4inversetranspose(_:).md)
- [GLKMatrixStackGetTypeID()](glkit/glkmatrixstackgettypeid().md)
- [GLKMatrixStackLoadMatrix4(_:_:)](glkit/glkmatrixstackloadmatrix4(_:_:).md)
- [GLKMatrixStackMultiplyMatrix4(_:_:)](glkit/glkmatrixstackmultiplymatrix4(_:_:).md)
- [GLKMatrixStackMultiplyMatrixStack(_:_:)](glkit/glkmatrixstackmultiplymatrixstack(_:_:).md)
- [GLKMatrixStackPop(_:)](glkit/glkmatrixstackpop(_:).md)
- [GLKMatrixStackPush(_:)](glkit/glkmatrixstackpush(_:).md)
- [GLKMatrixStackRotateWithVector3(_:_:_:)](glkit/glkmatrixstackrotatewithvector3(_:_:_:).md)
