dos33fsprogs/xmas_2019/sine_table.c

22 lines
336 B
C
Raw Normal View History

2019-12-16 05:52:07 +00:00
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv) {
int i,s;
for(s=4;s<16;s++) {
printf("sine_table%d:",s);
for(i=0;i<128;i++) {
if (i%16==0) printf("\n.byte\t");
printf("%2d",s+8+(15-s)+
2019-12-16 18:24:09 +00:00
(int)round(s*sin(i*2*3.14159265/128.0)));
2019-12-16 05:52:07 +00:00
if (i%16!=15) printf(",");
}
printf("\n");
}
return 0;
}