Math3d—a bit rough around the edges, but works well once you figure out the quirks. From what I can tell it doesn't understand juxtaposition multiplication with variables, i.e. you need to write $\sin(n\cdot\theta)$ instead of $\sin(n\theta)$.

Graph a torus with major radius $K$ and minor radius $k$.