def conv_to_2D(points, x, y):
    'Finds coordinates of points in a plane wrt a basis.\n\n       Given a list of points in a plane, and a basis of the plane,\n       this function returns the coordinates of those points\n       wrt this basis.\n\n       Arguments:\n       points: A numpy array of points.\n       x: One vector of the basis.\n       y: Another vector of the basis.\n\n       Returns:\n       Coordinates of the points wrt the basis [x,y].'
    mat = [x[0:2], y[0:2]]
    mat_inv = np.linalg.inv(mat)
    coords = np.matmul(points[:, 0:2], mat_inv)
    return coords
Finds coordinates of points in a plane wrt a basis.

Given a list of points in a plane, and a basis of the plane,
this function returns the coordinates of those points
wrt this basis.

Arguments:
points: A numpy array of points.
x: One vector of the basis.
y: Another vector of the basis.

Returns:
Coordinates of the points wrt the basis [x,y].
def conv_to_2D(points, x, y):
    'Finds coordinates of points in a plane wrt a basis.\n\n       Given a list of points in a plane, and a basis of the plane,\n       this function returns the coordinates of those points\n       wrt this basis.\n\n       Arguments:\n       points: A numpy array of points.\n       x: One vector of the basis.\n       y: Another vector of the basis.\n\n       Returns:\n       Coordinates of the points wrt the basis [x,y].'
    mat = [x[0:2], y[0:2]]
    mat_inv = np.linalg.inv(mat)
    coords = np.matmul(points[:, 0:2], mat_inv)
    return coords