Python Forum

Full Version: plotting equations
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have this program that draws a parametric equation

import turtle
from math import cos,sin,tan,pi

window = turtle.Screen()

pen = turtle.Turtle()
pen.hideturtle()
pen.pensize(3)
pen.penup()

angle = 0
theta = 0.01 
a=9
b=5
c=4
steps = int (250*pi/theta)

for t in range(0,steps):

        angle+=theta
        x=(cos(a*angle)+cos(b*angle)+cos(c*angle))*80
        y=(sin(a*angle)+sin(b*angle)+sin(c*angle))*80

        pen.goto(x,y)
        pen.pendown()
       
print ("it is done")

turtle.done()
Is there a way in which i can plot a parametric equation without the animation?
Why aren't you using matplotlib?
Call turtle.tracer(0, 0) before you start drawing and turtle.update() when you are done. tracer(0, 0) turns off the tracer and update() updates the screen to show what was drawn since the last update.