예제 #1
0
        public void ComplexDiLogSymmetry()
        {
            foreach (Complex z in TestUtilities.GenerateComplexValues(1.0E-2, 1.0E2, 12))
            {
                Assert.IsTrue(TestUtilities.IsSumNearlyEqual(
                                  AdvancedComplexMath.DiLog(z), AdvancedComplexMath.DiLog(-z),
                                  AdvancedComplexMath.DiLog(z * z) / 2.0
                                  ));

                Assert.IsTrue(TestUtilities.IsNearlyEqual(
                                  -AdvancedComplexMath.DiLog(1.0 / z),
                                  AdvancedComplexMath.DiLog(z) + ComplexMath.Log(-z) * ComplexMath.Log(-z) / 2.0 + Math.PI * Math.PI / 6.0
                                  ));

                Assert.IsTrue(TestUtilities.IsNearlyEqual(
                                  -AdvancedComplexMath.DiLog(1.0 - z),
                                  AdvancedComplexMath.DiLog(z) + ComplexMath.Log(z) * ComplexMath.Log(1.0 - z) - Math.PI * Math.PI / 6.0
                                  ));
            }
        }
        public void ComplexDiLogUnitCircle()
        {
            Assert.IsTrue(TestUtilities.IsNearlyEqual(
                              AdvancedComplexMath.DiLog(1.0),
                              Math.PI * Math.PI / 6.0
                              ));

            Assert.IsTrue(TestUtilities.IsNearlyEqual(
                              AdvancedComplexMath.DiLog(ComplexMath.I),
                              new Complex(-Math.PI * Math.PI / 48.0, AdvancedMath.Catalan)
                              ));

            Assert.IsTrue(TestUtilities.IsNearlyEqual(
                              AdvancedComplexMath.DiLog(-1.0),
                              -Math.PI * Math.PI / 12.0
                              ));

            Assert.IsTrue(TestUtilities.IsNearlyEqual(
                              AdvancedComplexMath.DiLog(-ComplexMath.I),
                              new Complex(-Math.PI * Math.PI / 48.0, -AdvancedMath.Catalan)
                              ));
        }