import torch


def get_relative_trafo(w_T_c1, w_T_c2):
    """Computes the relative transformation matrix between two camera matrices
    c1_T_w: [N, 4, 4] World to camera matrix 1
    c2_T_w: [N, 4, 4] World to camera matrix 2
    returns: [N, 4, 4] relative transformation matrix between camera1 and camera 2
    """
    return torch.linalg.inv(w_T_c1) @ w_T_c2