I am working with the cosine function with a very large input, like
cos(a* t), where
t varies between
~ 200; and
a can be as large as
I come across, as expected, the artifact error. If I sample
t with a stepsize of
a 100, I get a plot like this :
Notice, that for large value of
a, the sampling of
t needs to be fine, otherwise, you will not get regular cosine shape from
1. Sometimes, wave peaks, and other times wave troughs will be missed, due to low granularity, and you will end up with a different shape of the wave than the theoritical value.
a to be
100000, and as expected, the effect is much more pronounced.
My question : Is there a formula / algorithm, to avoid this effect? Is there a formula, that tells you the correct step size for a large value of
I tried to google the following keywords :
large input cosine function computer graphics, but that did not help.