import torch


def rotation_matrix(ang):
    """Get the rotation matrix for a specific angle.
    """
    s, c = torch.sin(ang), torch.cos(ang)
    rot_mat = ang.new_empty(2, 2)
    rot_mat[0, 0] = rot_mat[1, 1] = c
    rot_mat[0, 1], rot_mat[1, 0] = -s, s
    return rot_mat