之前用的兩個繪圖工具
#參數(shù)方程繪制器
import math, turtle
a = 0
b = 0
x = 0
y = 0
################################################################
#方程表達(dá)式
def f(a):
? ? x = 2*math.cos(a) #here
? ? return x
def g(a):
? ? y = math.sin(a) #here
? ? return y
#參數(shù)定義域? ?
left = 0
right = 2*math.pi
#畫面縮放
z = 100
#值差
l = 0.05
################################################################
turtle.speed(speed = 0)? ?
turtle.goto(0,0)
turtle.pendown()
for i in range(4):
? ? turtle.fd(500)
? ? turtle.goto(0,0)
? ? turtle.left(90)
turtle.penup()
turtle.goto(z,0)
turtle.pendown()
turtle.goto(z,z)
turtle.goto(0,z)
turtle.penup()
a = left
x = z*f(a)
y = z*g(a)
turtle.goto(x,y)
turtle.pendown()
turtle.left(135)
while a <= right+l:? ??
? ? x = z*f(a)? ??
? ? y = z*g(a)? ??
? ? turtle.goto(x,y)
? ? a = a + l
print('finish')

#極坐標(biāo)系方程繪制器
import math, turtle
a = 0
b = 0
x = 0
y = 0
################################################################
#方程表達(dá)式
def f(a):
? ? x = 100*math.sin(2*a) #here
? ? return x
#定義域
left = 0
right = math.pi*2
#畫面縮放
z = 100
#值差
l = 0.01
################################################################
turtle.speed(speed = 0)? ?
turtle.goto(0,0)
turtle.pendown()
for i in range(4):
? ? turtle.fd(500)
? ? turtle.goto(0,0)
? ? turtle.left(90)
turtle.penup()
turtle.goto(z,0)
turtle.pendown()
turtle.goto(z,z)
turtle.goto(0,z)
turtle.penup()
a = left
x = z*f(a)
turtle.goto(x,y)
turtle.pendown()
turtle.left(135)
while a <= right+l:? ??
? ? x = math.cos(a)*f(a)? ??
? ? y = math.sin(a)*f(a)? ??
? ? turtle.goto(x,y)
? ? a = a + l
print('finish')

注:這僅為輔助工具,必須按自己的需求修改程序才能正常使用。