---
title: rotate
framework: webkitjs
role: symbol
role_heading: Instance Method
path: webkitjs/webkitcssmatrix/1629773-rotate
---

# rotate

Returns the result of rotating this matrix by a given vector.

## Declaration

```data
WebKitCSSMatrix rotate(
    optional unrestricted double rotX, 
    optional unrestricted double rotY, 
    optional unrestricted double rotZ
);
```

## Parameters

- `rotX`: The x component in the vector, in degrees.
- `rotY`: The y component in the vector, in degrees. If undefined, the x component is used.
- `rotZ`: The z component in the vector, in degrees. If undefined, the x component is used.

## Return Value

Return Value A new matrix that is the result of rotating this matrix by each of the three rotation matrices about the major axes, first the x axes, y axes, and then z axes.

## Discussion

Discussion This matrix is not modified by this method.

## See Also

### Applying Operations

- [multiply](webkitjs/webkitcssmatrix/1631528-multiply.md)
- [inverse](webkitjs/webkitcssmatrix/1633805-inverse.md)
- [translate](webkitjs/webkitcssmatrix/1630758-translate.md)
- [scale](webkitjs/webkitcssmatrix/1632184-scale.md)
- [rotateAxisAngle](webkitjs/webkitcssmatrix/1632317-rotateaxisangle.md)
- [skewX](webkitjs/webkitcssmatrix/1633353-skewx.md)
- [skewY](webkitjs/webkitcssmatrix/1631022-skewy.md)
