Approximation of Sine function in Integer Forth
|
03-12-2022, 08:36 PM
(This post was last modified: 03-12-2022 11:08 PM by Thomas Klemm.)
Post: #2
|
|||
|
|||
RE: Approximation of Sine function in Integer Forth
(03-12-2022 04:25 PM)Martin Hepperle Wrote: Maybe there is another more elegant or more accurate approach? You could use Bhaskara's Sine and Cosine Approximations. They are accurate to about 1‰. Functions in Python Code: def sin(x): Plot the Difference Code: import matplotlib.pyplot as plt Sine Code: plt.plot(x, sin(x) - 1000 * np.sin(np.radians(x)), 'b') Cosine Code: plt.plot(x, cos(x) - 1000 * np.cos(np.radians(x)), 'r') Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)