A simple script to draw some parametric curves. You can pick among 8 different ones. There are plenty more on https://en.wikipedia.org/wiki/Parametric_equation if you wish to edit the code and add more options.

Selection 1

Selection 2

Code:

`"""`

This program draws a parametric curve of the form

x = A*(cos(a*t) - cos(b*t)**j)

y = B*(sin(c*t) - sin(d*t)**k)

https://en.wikipedia.org/wiki/Parametric_equation

"""

import turtle

import math

selection = int(input("To draw a parametric courve select a number from 1 to 8: "))

if selection == 1:

toup = (1, 80, 1, 80, 3, 3)

elif selection == 2:

toup = (80, 1, 1, 80, 3, 3)

elif selection == 3:

toup = (80, 1, 80, 1, 3, 3)

elif selection == 4:

toup = (1, 100, 1, 50, 3, 3)

elif selection == 5:

toup = (1, 80, 1, 80, 3, 4)

elif selection == 6:

toup = (1, 80, 1, 40, 3, 4)

elif selection == 7:

toup = (1, 60, 1, 120, 3, 4)

elif selection == 8:

toup = (80, 1, 1, 80, 3, 4)

def draw_curve(toup):

a, b, c, d, j, k = toup

t = 0

wn = turtle.Screen()

wn.title("Parametric Curve")

cursor = turtle.Turtle()

cursor.color("purple")

cursor.hideturtle()

cursor.speed("fastest")

cursor.pensize(1.5)

for i in range(14000):

x = 200*(math.cos(a*t) - math.cos(b*t)**j)

y = 200*(math.sin(c*t) - math.sin(d*t)**k)

cursor.setposition(x,y)

t = t + 0.001

turtle.done()

draw_curve(toup)

Selection 2