def METHOD_NAME(matrix: Union[np.ndarray, Matrix],
                                                            new_frame: List[str]) -> np.ndarray:
    """ Changes the coordinate frame the given transformation matrix is mapping to.
    Given a matrix $T_A^B$ that maps from A to B, this function can be used
    to change the axes of B into B' and therefore end up with $T_A^B'$.
    :param matrix: The matrix to convert in form of a np.ndarray or mathutils.Matrix
    :param new_frame: An array containing three elements, describing each axis of the new coordinate frame
                      based on the axes of the current frame. Available: ["X", "Y", "Z", "-X", "-Y", "-Z"].
    :return: The converted matrix is in form of a np.ndarray
    """
    tmat = MathUtility.build_coordinate_frame_changing_transformation_matrix(new_frame)
    # Apply transformation matrix
    output = np.matmul(tmat, matrix)
    return output