Can someone shed light on these two steps in the approximation?
* since cos(x+y) ~ cos(x) - sin(x)*y
* ~ cos(x) - x*y,
For the first, maybe it's an approximate identity I'd never heard of?For the second, it seems like it relies on X being small, but in this code... Y might be small enough for sin==identity approximation, but X isn't, is it?