我想编写一个绘制参数图的程序。我必须使用 matplotlib 和 sympy 和 n 步,n 是近似曲线的段数。我在使用 n 时遇到问题。我放了一个不使用 n 和库 matplotlib 的程序。
from sympy import *
from sympy.plotting import plot_parametric
import math
def param(x,y,t,a,b,n):
t = Symbol('t')
return plot_parametric(x,y,(t,a,b))
t = Symbol('t')
x=cos(t)
y=sin(t)
n=100
a=0
b=2*pi
plot_parametric(x,y,(t,0,2*pi),n)