public void ExecuteComplexNumberTest() { var complex = new Complex(3, 2); var exp = new Cos(new ComplexNumber(complex)); var result = (Complex)exp.Execute(); Assert.Equal(Complex.Cos(complex), result); Assert.Equal(-3.7245455049153224, result.Real, 14); Assert.Equal(-0.51182256998738462, result.Imaginary, 14); }
public void ExecuteRadianTest() { var exp = new Cos(new Number(1)); Assert.Equal(Math.Cos(1), exp.Execute(AngleMeasurement.Radian)); }
public void ExecuteDegreeTest() { var exp = new Cos(new Number(1)); Assert.Equal(Math.Cos(1 * Math.PI / 180), exp.Execute(AngleMeasurement.Degree)); }