From 799dbb975f6b1b50b024d9ef389bdcd87dcfa133 Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sun, 28 Jan 2024 15:41:57 +0100 Subject: [PATCH] added test for conversion of minus 180 degrees to radians --- src/test/py/test_trigonometry.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/py/test_trigonometry.py b/src/test/py/test_trigonometry.py index 3a347d4..e38fb9f 100644 --- a/src/test/py/test_trigonometry.py +++ b/src/test/py/test_trigonometry.py @@ -46,6 +46,12 @@ class MyTestCase(unittest.TestCase): delta *= -1 self.assertLess(delta, 0.01) + def test_negative_180_deg_to_rad_should_be_negative_pi(self): + delta = deg2rad(-180) - -math.pi + if delta < 0: + delta *= -1 + self.assertLess(delta, 0.01) + def test_sin_0_should_be_0(self): self.assertEqual(sin_approx_bhaskara(0), 0)