Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
plotting of graphs
#3
(Feb-10-2019, 04:32 AM)scidam Wrote:
(Feb-09-2019, 06:32 PM)mudezda1 Wrote: My question is how do i plot the two equations without knowing the value of theta?
I didn't see the value of theta...
(Feb-09-2019, 06:32 PM)mudezda1 Wrote: Is there anything wrong with my code?
You don't need math at all, since you are importing numpy. Also, you don't need to use loops. You need to create arrays of x- and y-values and plot the parametric graph.
import numpy as np import matplotlib.pyplot as plt # define your constants here... angles = np.arange(360) / 180 * np.pi # step is one degree x = 1 - ((2 * l) / d) * np.sin(angles) y = ((m * g) / (k * d)) * np.tan(angles) plt.plot(x, y) plt.show()
I sincerely thank you for your help.
Reply


Messages In This Thread
plotting of graphs - by mudezda1 - Feb-09-2019, 06:32 PM
RE: plotting of graphs - by scidam - Feb-10-2019, 04:32 AM
RE: plotting of graphs - by mudezda1 - Feb-11-2019, 12:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to plot 2 graphs in one figure? man0s 1 1,336 Apr-25-2022, 09:18 AM
Last Post: Axel_Erfurt
  Tuple Unpacking with graphs in matplotlib smw10c 2 5,942 Mar-23-2017, 05:13 PM
Last Post: smw10c

Forum Jump:

User Panel Messages

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