Skip to content

Instantly share code, notes, and snippets.

@wolfmanjm
Created May 3, 2022 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfmanjm/6a77382b59079cdddc0d22f21ecf1cad to your computer and use it in GitHub Desktop.
Save wolfmanjm/6a77382b59079cdddc0d22f21ecf1cad to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
x0=0 # First Position (Start)
xd=100 # Second Position (End)
T=100 # Time
x= [0] * 101
for t in range(0,101):
x[t]= x0+(xd-x0)*(10*((t/T)**3)-15*((t/T)**4)+6*((t/T)**5))
plt.plot(x)
plt.title('S-Curve for Motion')
plt.xlabel('Time')
plt.ylabel('Position')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment