import torch


def twoD_rot(angle, device="cpu"):
    """
    Creates a 2D rotation matrix of angle angle.
    """
    return torch.tensor([[torch.cos(angle), -torch.sin(angle)],
                         [torch.sin(angle), torch.cos(angle)]],
                        device=device)