How to plot the following 3D curve (as an example) using Sympy? I know just create an array for t and do this in Matplotlib, but I don't really want to plot this curve, rather to learn how to define and plot curves symbolically.
alpha(t) = (cos(t), sin(t), t)
from sympy import *
t = symbols('t')
alpha = [cos(t), sin(t), t]
# now what?
I have tried using the plot method in various ways but this has only resulted in either three separate 1D curves, or an error.
You have to use methods from sympy.plotting
, in your case your need plot3d_parametric_line
:
from sympy import *
from sympy.plotting import plot3d_parametric_line
t = symbols('t')
alpha = [cos(t), sin(t), t]
plot3d_parametric_line(*alpha)
or plot3d_parametric_line(cos(t), sin(t), t, (t, 0, 2*pi))
if you like to set limits of t.
Look for more examples to plot in 3d with sympy: https://github.com/sympy/sympy/blob/master/examples/beginner/plot_examples.py