Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Pow() [1/2]

static Complex System.Numerics.Complex.Pow ( Complex value,
Complex power )
inlinestatic

Definition at line 613 of file Complex.cs.

614 {
615 if (power == Zero)
616 {
617 return One;
618 }
619 if (value == Zero)
620 {
621 return Zero;
622 }
623 double real = value.m_real;
624 double imaginary = value.m_imaginary;
625 double real2 = power.m_real;
626 double imaginary2 = power.m_imaginary;
627 double num = Abs(value);
628 double num2 = Math.Atan2(imaginary, real);
629 double num3 = real2 * num2 + imaginary2 * Math.Log(num);
630 double num4 = Math.Pow(num, real2) * Math.Pow(Math.E, (0.0 - imaginary2) * num2);
631 return new Complex(num4 * Math.Cos(num3), num4 * Math.Sin(num3));
632 }
Complex(double real, double imaginary)
Definition Complex.cs:38
static readonly Complex Zero
Definition Complex.cs:10
static double Abs(Complex value)
Definition Complex.cs:239
static readonly Complex One
Definition Complex.cs:12

References System.Numerics.Complex.Complex(), System.Numerics.Complex.Abs(), System.Math.Atan2(), System.Math.Cos(), System.Math.E, System.Math.Log(), System.Numerics.Complex.m_imaginary, System.Numerics.Complex.m_real, System.Numerics.Complex.One, System.Math.Pow(), System.Math.Sin(), System.value, and System.Numerics.Complex.Zero.

Referenced by System.Numerics.Complex.Pow().