Finding values of cosine and sine