# required package using Oscar; using Plots; gr() # pyplot() # polynomial ring in variables X,Y R,(X,Y) = polynomial_ring(QQ,["X","Y"]); ##### 2D plots of a few plane curves ##### # degree 3 c(X,Y) = Y^2 - X^3; x = y = range(-1/2, 1/2, 1000); plot(x,y, c, st=:contour, xwiden=1.5, levels=[0], c=:black, cbar=false) # degree 5 q1(X,Y) = − 3*X^5 − 2*X^4*Y − 3*X^3*Y^2 + X*Y^4 + 3*Y^5 + 6*X^4 + 7*X^3*Y; q2(X,Y) = + 3*X^2*Y^2 − 2*X*Y^3 − 6*Y^4 − 3*X^3 − 5*X^2*Y + X*Y^2 + 3*Y^3; q(X,Y) = q1(X,Y) + q2(X,Y); x = y = range(-1, 2, 1000); plot(x,y, q, st=:contour, xwiden=1.5, levels=[0], c=:black, cbar=false) # degree 5 p1(X,Y) = 49*X^3*Y^2 − 50*X^2*Y^3 − 168*X^3*Y + 231*X^2*Y^2 − 60*X*Y^3; p2(X,Y) = 144*X^3 − 240*X^2*Y + 111*X*Y^2 − 18*Y^3 + 16*X^2 − 40*X*Y + 25*Y^2; p(X,Y) = p1(X,Y) + p2(X,Y); x = y = range(-10, 10, 1000); plot(x,y, p, st=:contour, xwiden=1.5, levels=[0], c=:black, cbar=false) # four–leaf clover, degree 6 s(X,Y) = (X^2+Y^2)^3 - 4*X^2*Y^2; x = y = range(-1, 1, 1000); plot(x,y, s, st=:contour, xwiden=1.5, levels=[0], c=:black, cbar=false) ##### elliptic curves ##### e(X,Y) = Y^2 - X*(X-1)*(X-lb); pt = [1,0]; len = 2; x = range(pt[1]-len, pt[1]+len, 1000); y = range(pt[2]-len, pt[2]+len, 1000); # singular cases lb=0,1 lb= -1; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= -1//2; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= -1//10; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 0; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 1//10; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 1//2; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 9//10; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 1; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 11//10; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false) lb= 2; plot(x,y,e,st=:contour,xwiden=1.5,levels=[0],c=:black,cbar=false)