Beispiel #1
0
        public void Argument()
        {
            Complex      cd1 = new Complex(1.1, -2.2);
            Complex      cd2 = new Complex(0, -2.2);
            Complex      cd3 = new Complex(1.1, 0);
            Complex      cd4 = new Complex(-1.1, 2.2);
            ComplexFloat cf1 = new ComplexFloat(1.1f, -2.2f);
            ComplexFloat cf2 = new ComplexFloat(0, -2.2f);
            ComplexFloat cf3 = new ComplexFloat(1.1f, 0);
            ComplexFloat cf4 = new ComplexFloat(-1.1f, 2.2f);

            Assert.AreEqual(ComplexMath.Argument(cd1), -1.107, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cd2), -1.571, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cd3), 0, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cd4), -1.107, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cf1), -1.107, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cf2), -1.571, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cf3), 0, TOLERENCE);
            Assert.AreEqual(ComplexMath.Argument(cf4), -1.107, TOLERENCE);
        }