#include <iostream>
#include <cmath>
int main()
{
double theta;
const double max = 6.28318; //estimate of 2pi
const int iterations = 20; //number of times to iterate - 1( the zero )
const double threshold = 0.0000001;
for( theta = 0.0; theta < max + threshold; theta += max / iterations )
{
std::cout << "Cos(" << theta << ") = " << cos( theta ) << std::endl;
//repeat for sin and tan.
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CgppbnQgbWFpbigpCnsKCWRvdWJsZSB0aGV0YTsKCWNvbnN0IGRvdWJsZSBtYXggPSA2LjI4MzE4OyAvL2VzdGltYXRlIG9mIDJwaQoJY29uc3QgaW50IGl0ZXJhdGlvbnMgPSAyMDsgLy9udW1iZXIgb2YgdGltZXMgdG8gaXRlcmF0ZSAtIDEoIHRoZSB6ZXJvICkKCWNvbnN0IGRvdWJsZSB0aHJlc2hvbGQgPSAwLjAwMDAwMDE7CgoJZm9yKCB0aGV0YSA9IDAuMDsgdGhldGEgPCBtYXggKyB0aHJlc2hvbGQ7IHRoZXRhICs9IG1heCAvIGl0ZXJhdGlvbnMgKQoJewogICAgCXN0ZDo6Y291dCA8PCAiQ29zKCIgPDwgdGhldGEgPDwgIikgPSAiIDw8IGNvcyggdGhldGEgKSA8PCBzdGQ6OmVuZGw7CiAgICAJLy9yZXBlYXQgZm9yIHNpbiBhbmQgdGFuLgoJfQoJcmV0dXJuIDA7Cn0=