Cosine function drawing C++