Home > database >  How to graph a mathematical function for "Distance and Speed over Time" in Python?
How to graph a mathematical function for "Distance and Speed over Time" in Python?

Time:12-04

I'm struggling with some Python homework.

I'm really new to Python, and coding in general. I have really basic knowledge in Python, and somewhat acceptable level in JavaScript.

My issue: I have to make a graph to represent these two functions:

distance = (x**2/2 - np.cos(5*x) - 7)

speed = (x   5*np.sin(5*x))

Between the timestamps 3 and 6 (inclusive)

I know I have to use Pandas to make a DataFrame, I know I have to use MatPlotLib to make the actual plot, and I have to use Numpy for the math to work, but I can't get the math to be recognised as mathematical functions because I simply don't know how.

This is what the graph should look like: enter image description here

  • Related