- 2,163
- 191
The discussion revolves around adjusting the range and scaling of a cosine function in Python for graphical representation. Participants explore how to modify the amplitude and range of the cosine function to achieve desired visual outcomes in plots.
Participants express varying levels of understanding and familiarity with Python, leading to some confusion and disagreement about the implementation details. Multiple approaches to adjusting the cosine function are proposed, but no consensus is reached on a single method.
Some participants highlight the need for clarity on the definitions of terms and functions used in Python, as well as the mathematical properties of the cosine function, which may affect the adjustments being discussed.
there's a syntax error in your code. Also no, I mean that I need to write a cos function that will look like my graph. Or cos^2x function. Both are okay for meMerlin3189 said:Do you mean
change t = np.cos(r)+10
to t = np.(cos(r) + 1) edit: or t = 12*(np.cos(r) + 1) ; if np. is not the amplitude
so that the lower extreme is on the y=0 axis?
r = np.arange(0,400,0.4)
t = (11*np.cos(r/28.7))+11
plt.plot(r,t)