当前位置: 首页>>代码示例>>C#>>正文


C# Complex.Square方法代码示例

本文整理汇总了C#中System.Complex.Square方法的典型用法代码示例。如果您正苦于以下问题:C# Complex.Square方法的具体用法?C# Complex.Square怎么用?C# Complex.Square使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Complex的用法示例。


在下文中一共展示了Complex.Square方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Triangle

 /// <summary>
 /// Creates a new triangle
 /// </summary>
 /// <param name="sideA">First side</param>
 /// <param name="sideB">Second side</param>
 /// <param name="sideC">Third side</param>
 public Triangle (Complex sideA, Complex sideB, Complex sideC)
 {
     SideA = sideA;
     SideB = sideB;
     SideC = sideC;
     AngleAB = Functions.ArcCos((sideA.Square() + sideB.Square() - sideC.Square()) / (2 * sideA * sideB));
     AngleBC = Functions.ArcCos((sideC.Square() + sideB.Square() - sideA.Square()) / (2 * sideC * sideB));
     AngleAC = Functions.ArcCos((sideA.Square() + sideC.Square() - sideB.Square()) / (2 * sideA * sideC));
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:15,代码来源:Triangle.cs

示例2: HComplex

        public HComplex()
        {
            Value = new Complex(0, 0);

            Attributes.Add("real", new HassiumProperty("real", x => Real, (self, x) => Real = x[0].HDouble().Value));
            Attributes.Add("imaginary", new HassiumProperty("imaginary", x => Imaginary, (self, x) => Imaginary = x[0].HDouble().Value));
            Attributes.Add("imag", new HassiumProperty("imag", x => Imaginary, (self, x) => Imaginary = x[0].HDouble().Value));

            Attributes.Add("module", new HassiumProperty("module", x => (double)Value.Module, null, true));
            Attributes.Add("argument", new HassiumProperty("argument", x => (double)Value.Argument, null, true));
            Attributes.Add("conjugate", new HassiumProperty("conjugate", x => (double)Value.Conjugate, null, true));

            Attributes.Add("__add", new InternalFunction(Add, -1));
            Attributes.Add("__substract", new InternalFunction(Substract, -1));
            Attributes.Add("__multiply", new InternalFunction(Multiply, -1));
            Attributes.Add("__divide", new InternalFunction(Divide, -1));

            Attributes.Add("__compare", new InternalFunction(x =>
            {
                var v = x[0].HComplex().Value;
                if (v > Value) return 1;
                if (v < Value) return -1;
                return 0;
            }, 1));

            Attributes.Add("__pow", new InternalFunction(x => new HComplex(Functions.Pow(Value, x[0].HComplex().Value)), 1));
            Attributes.Add("__root", new InternalFunction(x => new HComplex(Functions.NthRoot(Value, x[0].HComplex().Value)), 1));

            Attributes.Add("negate", new InternalFunction(Negate, 0));

            Attributes.Add("square", new InternalFunction(x => new HComplex(Value.Square()), 0));
        }
开发者ID:HassiumTeam,项目名称:HassiumModules,代码行数:32,代码来源:HComplex.cs

示例3: ArcCos

        public static Complex ArcCos(Complex value)
        {
            if (value.IsReal()) return Math.Acos(value.Real);

            /*if (value.Imaginary < 0 || value.Imaginary == 0d && value.Real > 0)
			{
				return Constant.Pi - Acos(-value);
			}
			*/
            return -Complex.ImaginaryOne * Ln(value + Complex.ImaginaryOne * Sqrt(1 - value.Square()));

            //return (Constant.Pi / 2.0) + Constant.I * Ln(Constant.I * value + Sqrt(1 - value.Square()));
        }
开发者ID:zdimension,项目名称:IMPression,代码行数:13,代码来源:Functions.cs

示例4: ArcSin

        public static Complex ArcSin(Complex value)
        {
            if (value.IsReal()) return Math.Asin(value.Real);

            if (value.IsImaginary() || value.Imaginary == 0d && value.Real < 0)
            {
                return -ArcSin(-value);
            }

            return -Complex.ImaginaryOne * Sqrt(Ln((1 - value.Square())) + (Complex.ImaginaryOne * value));
        }
开发者ID:zdimension,项目名称:IMPression,代码行数:11,代码来源:Functions.cs

示例5: HermiteHFunc

 public static Complex HermiteHFunc(Complex nu, Complex z)
 {
     return Pow(2.0, nu) * Sqrt(Constants.Pi) *
            (1.0 / Gamma((1.0 - nu) / 2) * Hypergeometric1F1(-nu / 2.0, 0.5, z.Square()) -
             (2.0 * z) / Gamma(-nu / 2.0) * Hypergeometric1F1((1.0 - nu) / 2.0, 1.5, z.Square()));
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:6,代码来源:Functions.cs

示例6: FibonacciFunc

 public static Complex FibonacciFunc(Complex nu, Complex z)
 {
     return (Pow(2.0, -nu) * Pow(z + Sqrt(z.Square() + 4.0), nu) -
             Cos(nu * Constants.Pi) * Pow(2.0, nu) * Pow(z + Sqrt(z.Square() + 4.0), -nu)) /
            Sqrt(z.Square() + 4.0);
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:6,代码来源:Functions.cs

示例7: ChebyshevUFunc

 public static Complex ChebyshevUFunc(Complex nu, Complex z)
 {
     return Sin((nu + 1.0) * ArcCos(z)) / Sqrt(1.0 - z.Square());
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例8: AreaCylinder

 public static Complex AreaCylinder(Complex radius, Complex height)
 {
     return 2 * Constants.Pi * radius.Square() + 2 * Constants.Pi * radius * height;
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例9: AreaCube

 public static Complex AreaCube(Complex side)
 {
     return 6.0 * side.Square();
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例10: AreaSphere

 public static Complex AreaSphere(Complex radius)
 {
     return 4 * Constants.Pi * radius.Square();
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例11: AreaPolygon

 public static Complex AreaPolygon(Complex sides, Complex length)
 {
     return (sides * length.Square()) / (4 * Tan(Constants.Pi / sides));
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例12: AreaSector

 public static Complex AreaSector(Complex radius, Complex angle)
 {
     return (radius.Square() / 2.0) * Angle(angle);
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例13: AreaCircle

 public static Complex AreaCircle(Complex radius)
 {
     return Constants.Pi * radius.Square();
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例14: AreaSquare

 public static Complex AreaSquare(Complex cote)
 {
     return cote.Square();
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs

示例15: ArcTan

 public static Complex ArcTan(Complex x, Complex y)
 {
     return 2.0 * ArcTan(y / (Sqrt(x.Square() + y.Square()) + x));
 }
开发者ID:zdimension,项目名称:IMPression,代码行数:4,代码来源:Functions.cs


注:本文中的System.Complex.Square方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。