numworks / epsilon

Modern graphing calculator operating system.
https://www.numworks.com/resources/engineering/software/
1.75k stars 467 forks source link

Bug plotting a function in python #2241

Closed fasfcastro closed 1 month ago

fasfcastro commented 1 month ago

Describe the bug

In the two python scripts below the first one works but the second fails and mathematically they are de same. See differences in the definition of f(x)

—- good script from numpy import * import matplotlib.pyplot as plt

def f(x): return cos(x)*10.

x=linspace(0.1,0.5,50)

plt.plot(x,f(x)) plt.grid() plt.show()

——- bad script from numpy import * import matplotlib.pyplot as plt

def f(x): return 10.*cos(x)

x=linspace(0.1,0.5,50)

plt.plot(x,f(x)) plt.grid() plt.show()

Environment

adri1numworks commented 1 month ago

This bug is already identified. A fix was proposed. Closed as duplicate of #2102