For the sake of optimization, I decided to make a sign in which sines and cosines will lie. Draws almost as it should.
there is a peak. I can not understand why and from where it is taken.
sincos::sincos(){ double step = 6.28318530717958647692 / 4096.0f; sinTable = new float[4099]; cosTable = new float[4099]; int index = 0; for (double i = 0; i < 6.28318530717958647692; i += step) { sinTable[index] = std::sin(i); cosTable[index] = std::cos(i); index++; } float sincos::getSin(float val) { val = fmod(val, 6.28318530717958647692); return sinTable[(int)(4096.0f * val / 6.28318530717958647692)]; } float sincos::getCos(float val) { val = fmod(val, 6.28318530717958647692); return cosTable[(int)(4096.0f * val / 6.28318530717958647692)]; } 
sincosin the place where they are required (I was not mistaken, it wassincos, and not separatesinandcos). You first profile .. - borisbn