This looks like homework. Please look at:
- implicit plots : https://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/implicit_plot3d.html
- interact :
- https://doc.sagemath.org/html/en/prep/Quickstarts/Interact.html
- https://wiki.sagemath.org/interact/