Implementing Cosine in C from Scratch (2020)
> cosine repeats every 2pi> We can do better since the cosine values are equivalent every multiple of pi, except that the sign flips.There is one more step to take: Each π/2 long segment has identical shape, they are just pointing up or down (like you already noticed), and left or right. So you can reduce you basic domain down to not just 0...π, but to 0...π/2.