import numpy as np

def covarianceEllipse(cov_mat,img_dim = (1,1), center_point = (0,0)):
    eigenvalues, eigenvectors = np.linalg.eig(cov_mat)
    theta = np.linspace(0, 2*np.pi, 1000)
    ellipse = (np.sqrt(eigenvalues[None,:]) * eigenvectors) @ [np.sin(theta), np.cos(theta)]
    ellipse[0,:] = ellipse[0,:]*img_dim[0]
    ellipse[1,:] = ellipse[1,:]*img_dim[1]
    print(center_point[0],center_point[1],"\n---------------------\n")
    for i in range(ellipse.shape[1]):
        ellipse[0,i] += center_point[0]
        ellipse[1,i] += center_point[1]

    return ellipse

