This performs a so-called active or alibi transformation: rotates the
vector while the coordinate system remains unchanged. To do the opposite
operation (passive or alias transformation) call the function as
rotate(vec, ax, -angle) or use the convenience function transform.