Hacker News new | ask | show | jobs
by omrjml 1517 days ago
Periodic function like sin(x) are not a dynamical system so its previous state does not determine the current state. So it should be approximated in that way.
4 comments

Periodic functions like sin(x) are the solutions to differential equations like dy/dx = -y that describe for example, oscillations of springs, to name but one of an extremely large number of dynamical systems that behave this way.
Of course sine can appear in the solution for dynamical systems but the function itself is not dynamical. When evaluating sin(x) you do not need to know about the previous state.
That is true, the problem is with the conclusion you drew from that fact:

> So it should not be approximated in that way.

We can’t conclude a dynamic approximation is a bad approach based purely on the fact the underlying function isn’t dynamic.

The function might nevertheless be easily approximated via dynamics — as in the case of predicting sine from seeing the recent history.

sin(x) only arises as solution in second order systems. So d^2x/dt^2 = -x
Sorry, you're absolutely correct. Brain fart. The equation I wrote actually is for an exponential, whoops.
It's completely valid and equivalent to formulate trigonometric functions as a dynamic system (x,y-coordinates as you go around the circle using a rotation matrix).
It sounds like you're trying to say something different than the comment you replied to. sin(x) for a range of x is trivial to draw by looking at earlier parts of the curve to determine what to draw next. Back in the slow 1980's home computer days, on machines without floating point and multiply/divide, we quickly got used to approximate sine waves numerically by simply typing out sequences of integers with a rough idea of the wave it'd produce. If you gave me a subset of such a sequence and asked me to complete it, I wouldn't need much of it to assume you were wanting to approximate sin.
Edit: should not be approximated