I need to include in a paper a drawing of a "non trivial" algebraic curve.

I have found (with Google) the following example:

x^2 + y^2 + z^2 + 8)^2 - 36 (x^2 + y^2) = 0  
y^2 + (z - 2)^2 - 4 = 0
-4 <= x <= 4
-4 <= y <= 4
-2 <= z <= 2

Is it possible to have a nice representation of this curve with LaTeX?

Here is a drawing of this curve:

enter image description here

PS: If you know other nice space algebraic curves that might be easier to draw, I would also be interested.

  • why not simply include the image? Someone will no doubt take up the challenge to write it in tikz but what do you gain? Nov 15, 2020 at 10:20
  • With LaTeX, I could have more control on the drawing and be able to produce something more beautiful
    – Colas
    Nov 15, 2020 at 10:22
  • 1
    Look at here.
    – user213378
    Nov 26, 2020 at 0:52

1 Answer 1


The pstricks package pst-3dplot has a \parametricplotThreeD command for space curves. Here is, as an example, Viviani's curve (intersection of a sphere and a cylinder tangent to the sphere and passing through its centre):

\documentclass[svgnames, border=6pt]{standalone}
\usepackage{pst-3dplot, pst-math}


\psset{xPlotpoints = 500, plotstyle=curve, algebraic, arrowinset=0.2, labelsep=3pt}
\pstThreeDCoor[zMax=5, yMax=4, xMax=5.5, linecolor=LightSteelBlue]
\psset{linewidth=1.5pt, linecolor=Coral}
\parametricplotThreeD(-\pstPI2, \pstPI2){\R*(cos(t))^2|\R*sin(2*t)/2|\R*sin(t)}
\parametricplotThreeD(-\pstPI1, -\pstPI2){\R*(cos(t))^2|\R*sin(2*t)/2|\R*sin(t)}
\pstThreeDLine[linecolor=LightSteelBlue, linewidth=0.8pt](0,0,3)(0,0,4.5)


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .