dos33fsprogs/demos/xmas_2019/sine_table.c
Vince Weaver b1238af49d re-arranged the entire directory structure
this will probably upset people
2021-01-05 15:29:31 -05:00

22 lines
336 B
C

#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)+
(int)round(s*sin(i*2*3.14159265/128.0)));
if (i%16!=15) printf(",");
}
printf("\n");
}
return 0;
}