Ejemplo n.º 1
0
        public void Asin()
        {
            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);

            Complex cdt = ComplexMath.Asin(cd1);

            Assert.AreEqual(cdt.Real, 0.433, TOLERENCE);
            Assert.AreEqual(cdt.Imag, -1.618, TOLERENCE);

            cdt = ComplexMath.Asin(cd2);
            Assert.AreEqual(cdt.Real, 0, TOLERENCE);
            Assert.AreEqual(cdt.Imag, -1.530, TOLERENCE);

            cdt = ComplexMath.Asin(cd3);
            Assert.AreEqual(cdt.Real, 1.571, TOLERENCE);
            Assert.AreEqual(cdt.Imag, -0.444, TOLERENCE);

            cdt = ComplexMath.Asin(cd4);
            Assert.AreEqual(cdt.Real, -0.433, TOLERENCE);
            Assert.AreEqual(cdt.Imag, 1.618, TOLERENCE);

            ComplexFloat cft = ComplexMath.Asin(cf1);

            Assert.AreEqual(cft.Real, 0.433, TOLERENCE);
            Assert.AreEqual(cft.Imag, -1.618, TOLERENCE);

            cft = ComplexMath.Asin(cf2);
            Assert.AreEqual(cft.Real, 0, TOLERENCE);
            Assert.AreEqual(cft.Imag, -1.530, TOLERENCE);

            cft = ComplexMath.Asin(cf3);
            Assert.AreEqual(cft.Real, 1.571, TOLERENCE);
            Assert.AreEqual(cft.Imag, -0.444, TOLERENCE);

            cft = ComplexMath.Asin(cf4);
            Assert.AreEqual(cft.Real, -0.433, TOLERENCE);
            Assert.AreEqual(cft.Imag, 1.618, TOLERENCE);
        }