I have used matching square to draw contour plot but when I calculate contour value, I used f(x,y)=(X*X+Y*Y+a*a)*(X*X+Y*Y+a*a)-4*a*a*X*X-b*b*b*b, where a and b are constant values. Based on this calculation, I always get Ovals since this equation is Ovals of Cassini function. I am wondering if anyone knows that if there is a general equation which can be used to do general calculation so that when contour plot is draw, it will represent real data. any suggestion will be really appreciated.