ds: fix up some things

This commit is contained in:
Vince Weaver 2019-10-31 21:05:42 -04:00
parent d7f7c5921d
commit ae4b392cb5
2 changed files with 17 additions and 6 deletions

View File

@ -1,9 +1,9 @@
ANSI2PNG = ~/research/ansi2gif/ansi2gif.git/ansi2png
all: kfest.png
all: kfest2020.png
kfest.png: kfest.ans
$(ANSI2PNG) --ysize auto kfest.ans > kfest.png
kfest2020.png: kfest2020.ans
$(ANSI2PNG) --ysize auto kfest2020.ans > kfest2020.png
clean:
rm -f kfest.png *~
rm -f kfest2020.png *~

View File

@ -2,7 +2,18 @@
#include <math.h>
#define ANGLE_STEPS 16
#define ANGLE_STEPS 64
static int double_to_fixed(double d) {
int temp;
temp=d*4096;
return temp;
}
int main(int argc, char **argv) {
@ -12,7 +23,7 @@ int main(int argc, char **argv) {
printf("Sin\n");
for(i=0;i<ANGLE_STEPS;i++) {
angle=3.1415926535897932384*2.0*((double)i/(double)ANGLE_STEPS);
printf("%d %lf\n",i,sin(angle));
printf("%d %lf %x\n",i,sin(angle),double_to_fixed(sin(angle)));
}
printf("Cos\n");