From e8364e95ee1b38e49af29a2aa1338b3d978411f0 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Thu, 29 Sep 2022 16:39:09 -0400 Subject: Trigonometry somewhat works --- tools/gen-trig-test.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'tools') diff --git a/tools/gen-trig-test.c b/tools/gen-trig-test.c index 365a90d..54b39bf 100644 --- a/tools/gen-trig-test.c +++ b/tools/gen-trig-test.c @@ -11,25 +11,24 @@ #include #include -/* This code was used to generate floating numbers found in testData.h - * It's purpose is to generate a list of expected outputs for the sine - * and cosine function with a given number. It uses the math.h library +/* This code was used to generate double precision floating point numbers found + * in testData.h It's purpose is to generate a list of expected outputs for the + * sine and cosine function with a given number. It uses the math.h library * which cannot be used for the assignment and which is therefore a great * subject to test and compare with. * - * The generated [][3]int list is organized as follows: - * { original_value, expected_sine, expected_cosine } + * The generated [][3]int list is organized as follows: { original_value, + * expected_sine, expected_cosine } * - * Values chosen here test the following edge cases, - * - Common trigonometric circle identities (0°,30°,45°,60°,90°, etc...) - * - Negative values - * - Values surpassing 2π + * Values chosen here test the following edge cases, - Common trigonometric + * circle identities (0°,30°,45°,60°,90°, etc...) - Negative values - Values + * surpassing 2π */ int main(){ // list of number {{{ - float lst[20] = { + double lst[20] = { 0, // 0° M_PI/6, // 30° M_PI/4, // 45° @@ -56,17 +55,16 @@ int main(){ printf("int piValues[][] = {\n"); int max = (sizeof(lst)/sizeof(lst[0]))-1; - printf("%d",max); for (int i=0; i