@Test public void cotangens() throws FileNotFoundException, UnsupportedEncodingException { MyExpression expression = new MyExpression(); expression.cot = new Cot(); for (Interval i : intervals) { for (double x = i.getX0(); x <= i.getX1(); x += i.getD()) assertEquals(((((pow(2, 2.0 * 3.0) - (-1) * (1 / tan(x)))))), expression.calc(x), 0.01); } Plotter.plot("/Users/Scotch/graph_ctg.csv", expression, intervals); }
@Test public void testAllReal() throws FileNotFoundException, UnsupportedEncodingException { MyExpression expression = new MyExpression(); expression.cos = new Cos(); expression.sin = new Sin(); expression.cot = new Cot(); expression.tan = new Tg(); expression.csc = new Cosecant(); for (Interval i : intervals) { for (double x = i.getX0(); x <= i.getX1(); x += i.getD()) assertEquals( ((((pow(cos(x) + csc(x), 2.0 * 3.0) - ((sin(x) - tan(x)) - cos(x)) * (cot(x) * tan(x)))))), expression.calc(x), 0.01); } Plotter.plot("/Users/Scotch/graph_all_real.csv", expression, intervals); }