Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
plotting equations
#1
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?
Reply
#2
Why aren't you using matplotlib?
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  plotting from 3 differential equations grknkilicaslan 1 1,632 Jul-08-2020, 03:38 PM
Last Post: Gribouillis
  Plotting of equations mudezda1 1 2,369 Feb-13-2019, 07:26 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020