Commit ed89fd5b authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

sincos: calculate sin/cos for full -360/360 deg range

parent 797d2335
......@@ -57,6 +57,12 @@ float small_sin(int deg)
deg -= 90;
if (deg<=90)
return q*SIN_LUP[255-(int)(deg*SIN_STEP)]/65535.0;
deg -= 90;
if (deg<=90)
return -q*SIN_LUP[(int)(deg*SIN_STEP)]/65535.0;
deg -= 90;
if (deg<=90)
return -q*SIN_LUP[255-(int)(deg*SIN_STEP)]/65535.0;
return 0xff;
}
......@@ -70,6 +76,12 @@ float small_cos(int deg)
deg -= 90;
if (deg<=90)
return -SIN_LUP[(int)(deg*SIN_STEP)]/65535.0;
deg -= 90;
if (deg<=90)
return -SIN_LUP[255-(int)(deg*SIN_STEP)]/65535.0;
deg -= 90;
if (deg<=90)
return SIN_LUP[(int)(deg*SIN_STEP)]/65535.0;
return 0xff;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment