|
@ -52,15 +52,24 @@ void test_degrees_to_radians(){ |
|
|
r3 = radians(51.6); |
|
|
r3 = radians(51.6); |
|
|
r4 = radians(36.97); |
|
|
r4 = radians(36.97); |
|
|
|
|
|
|
|
|
printf("%lf\n", r1); |
|
|
|
|
|
printf("%lf\n", r2); |
|
|
|
|
|
printf("%lf\n", r3); |
|
|
|
|
|
printf("%lf\n", r4); |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 1.570796, r1); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 1.570796, r1); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, pi(1e-8), r2); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, pi(1e-8), r2); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.900589, r3); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.900589, r3); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.645248, r4); |
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.645248, r4); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_sin(void){ |
|
|
|
|
|
double r1, r2, r3, r4; |
|
|
|
|
|
|
|
|
|
|
|
r1 = sinD(50.0); |
|
|
|
|
|
r2 = sinD(90.0); |
|
|
|
|
|
r3 = sinD(36.97); |
|
|
|
|
|
r4 = sinD(180.0); |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.766044, r1); |
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 1.0, r2); |
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.601396, r3); |
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.0, r4); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |