Commit 19bafab2 authored by Tony Alas's avatar Tony Alas
Browse files

Merge branch 'alas-version-4.0' into 'master'

version 4.0

See merge request !3
parents 6033c022 03cec760
No preview for this file type
......@@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test;
public class TrigTest {
//Variable Decleration
//Variable Declaration
Trig t;
double x;
double x1;
......@@ -16,6 +16,11 @@ public class TrigTest {
double x3;
double x4;
double x5;
double x6;
double x7;
double x8;
double x9;
static double negPI = -3.1415926535;
static double PI = 3.1415926535;
//Setting up the variables
......@@ -28,9 +33,13 @@ public class TrigTest {
x3 = PI;
x4 = 45;
x5 = 180;
x6 = negPI;
x7 = negPI/4;
x8 = 2*negPI;
x9 = 2*negPI/3;
}
//Tests to ensure that the Cos funciton in Trig works properly
//Tests to ensure that the Cos function in Trig works properly
@Test
void testTrigCos() {
// to do... write test cases for cosine
......@@ -38,27 +47,39 @@ public class TrigTest {
assertEquals(t.trigCos(x1), Math.cos(x1), 0.000005);
assertEquals(t.trigCos(x2), Math.cos(x2), 0.000005);
assertEquals(t.trigCos(x3), Math.cos(x3), 0.000005);
assertEquals(t.trigCos(x6), Math.cos(x6), 0.000005);
assertEquals(t.trigCos(x7), Math.cos(x7), 0.000005);
assertEquals(t.trigCos(x8), Math.cos(x8), 0.000005);
assertEquals(t.trigCos(x9), Math.cos(x9), 0.000005);
}
//Tests to ensure that the Sin funciton in Trig works properly
//Tests to ensure that the Sin function in Trig works properly
@Test
void testTrigSin() {
assertEquals(t.trigSin(x), Math.sin(x), 0.000005);
assertEquals(t.trigSin(x1), Math.sin(x1), 0.000005);
assertEquals(t.trigSin(x2), Math.sin(x2), 0.000005);
assertEquals(t.trigSin(x3), Math.sin(x3), 0.000005);
assertEquals(t.trigSin(x6), Math.sin(x6), 0.000005);
assertEquals(t.trigSin(x7), Math.sin(x7), 0.000005);
assertEquals(t.trigSin(x8), Math.sin(x8), 0.000005);
assertEquals(t.trigSin(x9), Math.sin(x9), 0.000005);
}
//Tests to ensure that the Tan funciton in Trig works properly
//Tests to ensure that the Tan function in Trig works properly
@Test
void testTrigTan() {
assertEquals(t.trigTan(x), Math.tan(x), 0.000005);
assertEquals(t.trigTan(x1), Math.tan(x1), 0.000005);
assertEquals(t.trigTan(x2), Math.tan(x2), 0.000005);
assertEquals(t.trigTan(x3), Math.tan(x3), 0.000005);
assertEquals(t.trigTan(x6), Math.tan(x6), 0.000005);
assertEquals(t.trigTan(x7), Math.tan(x7), 0.000005);
assertEquals(t.trigTan(x8), Math.tan(x8), 0.000005);
assertEquals(t.trigTan(x9), Math.tan(x9), 0.000005);
}
//Tests to ensure that the degree to rad funciton in Trig works properly
//Tests to ensure that the degree to rad function in Trig works properly
@Test
void testDegToRad()
{
......@@ -69,7 +90,7 @@ public class TrigTest {
assertEquals(t.convertDegreesToRadians(x5), Math.toRadians(x5), 0.000005);
}
//Tests to ensure that the rad to degree funciton in Trig works properly
//Tests to ensure that the rad to degree function in Trig works properly
@Test
void testRadToDeg()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment