Function rotate2d

rotate2d(theta) returns a 2D rotation around the origin by a given angle $\theta$, encoded via the $2 \times 2$ matrix.