| Hosted by CoCalc | Download
Kernel: SageMath 9.5

Hearts for Valentine's Day

See the same code as a Sage worksheet: https://cocalc.com/drxyzzy/hearts/hearts-sageworksheet

See also: a rose, contributed by Andrzej Chrzeszczyk: https://cocalc.com/wstein/support/rose

Sources:

x,y,z = var ('x','y','z') w = 1.5 p = implicit_plot3d((x^2+(9/4)*y^2+z^2-1)^3-x^2*z^3-(9/80)*y^2*z^3 == 0, (x,-w,w),(y,-w,w),(z,-w,w), plot_points=80, color='red', smooth=False, frame=False) p.show(viewer='threejs', online=True)
r2(x,y) = x^2 + y^2 theta(x,y) = arctan2(y,x) f(x,y) = r2(x,y) - (1 - sin(theta(x,y)))^2 implicit_plot(f, (-1.3,1.3), (-2,1/4))
Image in a Jupyter notebook