I am trying to create an ABC logo and animate it with matplotlib, I have got all the phases by changing the delta index I am able to get all x and y coordinates but I am not able to animate from one phase to another .below is the link of what I am trying to do. https://www.youtube.com/watch?v=sL0FhqGtV4U&ab_channel=AustralianTelevisionArchive
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import math
import numpy as np
from matplotlib.animation import FuncAnimation
fig = plt.figure()
axis = plt.axes(xlim =(-110, 110),
ylim =(-110, 110))
delta = [0, 3.14 / 8, 3.14 / 4, 3 * 3.14 / 8, 3.14 / 2, 5 * 3.14 / 8, 3 * 3.14 / 8, 7 * 3.14 / 8, 3.14]
def dS(delta):
A = 100
B = 100
a = 1
b = 3
# delta = 3.14/4
t = 0
sinVals = []
cosVals = []
for i in range(0, 1000):
t += 0.01
# Apply Lissajous Parametric Equations
sinVals.append(A * math.sin(a * t + delta))
cosVals.append(B * math.sin(b * t))
return sinVals,cosVals
sinVals,cosVals=deltaShift.dS(delta[1])
line, = axis.plot(sinVals, cosVals)
plt.show()
This will produce what you want
The output gif file is