From 553a9c34e11562d7e99bf0cf1abba33d2dd1af74 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 16 Oct 2021 15:40:00 -0400 Subject: [PATCH] plasma: add helper --- graphics/gr/plasma/make_sine.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 graphics/gr/plasma/make_sine.c diff --git a/graphics/gr/plasma/make_sine.c b/graphics/gr/plasma/make_sine.c new file mode 100644 index 00000000..6efefc0a --- /dev/null +++ b/graphics/gr/plasma/make_sine.c @@ -0,0 +1,22 @@ +#include +#include + +#define PI 3.14159265358979323846264338327950 + +int main(int argc, char **argv) { + + double d; + int i,r; + + for(i=0;i<16;i++) { + + d=(((double)i)*2.0*PI)/16.0; + + r=32*sin(d); + + printf("%i, %02X\n",i,r); + + } + + return 0; +}