# rotationMatrix() Function & Examples

Use the rotationMatrix() matrix function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## rotationMatrix

#### rotationMatrix(theta)

#### rotationMatrix(theta, v)

#### rotationMatrix(theta, v, format)

Try it yourself:

```calculio
rotationMatrix(pi / 2)
rotationMatrix(unit("45deg"), [0, 0, 1])
rotationMatrix(1, matrix([0, 0, 1]), "sparse")
```

[cos](https://calcul.io/function/cos/index.md)

[sin](https://calcul.io/function/sin/index.md)

---

## rotationMatrix(): Matrix for Geometric Rotation

**rotationMatrix()** constructs a matrix that rotates coordinates by a specified angle. In two dimensions, multiplying a point by this matrix turns it around the origin without changing its length.

## Angles and orientation

Use radians consistently with [sin()](https://calcul.io/function/sin/index.md) and [cos()](https://calcul.io/function/cos/index.md). Multiplication order and row-versus-column vector conventions matter; verify one known point before applying a rotation to a full data set.

Apply the result with [multiply()](https://calcul.io/function/multiply/index.md), inspect dimensions with [size()](https://calcul.io/function/size/index.md), and use [transpose()](https://calcul.io/function/transpose/index.md) when adapting between vector orientations. Rotation preserves distance, so [norm()](https://calcul.io/function/norm/index.md) provides a useful check.

[All functions](https://calcul.io/functions/index.md)
