123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class TrigTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class TrigTest
- {
- /**
- * Default constructor for test class TrigTest
- */
- public TrigTest()
- {
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Before
- public void setUp()
- {
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @After
- public void tearDown()
- {
- }
-
- @Test
- public void testSIN()
- {
- Trig trig1 = new Trig();
- assertEquals(-0.54402111088, trig1.calcSin(10), 0.1);
- }
-
- @Test
- public void testCOS()
- {
- Trig trig1 = new Trig();
- assertEquals(-0.83907152907, trig1.calcCos(10), 0.1);
- }
-
- @Test
- public void testTAN()
- {
- Trig trig1 = new Trig();
- assertEquals(0.64836082745, trig1.calcTan(10), 0.1);
- }
-
- @Test
- public void testRadtoDeg()
- {
- Trig trig1 = new Trig();
- assertEquals(37.14833901458697, trig1.toDegrees(0.64836082745), 0.1);
- }
-
- @Test
- public void testArcSin()
- {
- Trig trig2 = new Trig();
- assertEquals(0.523598776, trig2.calcArcsin(0.5), 0.1);
- }
-
- @Test
- public void testArcTan()
- {
- Trig trig1 = new Trig();
- assertEquals(0.463647609, trig1.calcArctan(0.5), 0.1);
- }
-
- @Test
- public void testArcCos()
- {
- Trig trig1 = new Trig();
- assertEquals(1.04719755, trig1.calcArccos(0.5), 0.1);
- }
-
- @Test
- public void testLog()
- {
- Trig trig1 = new Trig();
- assertEquals(1, trig1.calcLog(10), 0.1);
- }
- }
-
-
-
-
-
-
-
-
|