Exemple #1
0
 public static Complex Divide(ref Complex left, ref Complex right)
 {
     return(new Complex(right.Real * left.Real + right.Imaginary * left.Imaginary,
                        right.Real * left.Imaginary - right.Imaginary * left.Real));
 }
Exemple #2
0
        public static Complex Normalize(ref Complex value)
        {
            var mag = value.Magnitude;

            return(new Complex(value.Real / mag, -value.Imaginary / mag));
        }
Exemple #3
0
 public static Complex Multiply(ref Complex left, ref Complex right)
 {
     return(new Complex(left.Real * right.Real - left.Imaginary * right.Imaginary,
                        left.Imaginary * right.Real + left.Real * right.Imaginary));
 }
Exemple #4
0
 public static Complex Negate(ref Complex value)
 {
     return(new Complex(-value.Real, -value.Real));
 }
Exemple #5
0
 public static Complex Conjugate(ref Complex value)
 {
     return(new Complex(value.Real, -value.Imaginary));
 }
Exemple #6
0
 public static void Divide(Vector2 left, ref Complex right, out Vector2 result)
 {
     result = new Vector2(left.X * right.Real + left.Y * right.Imaginary,
                          left.Y * right.Real - left.X * right.Imaginary);
 }
Exemple #7
0
 public static Vector2 Divide(Vector2 left, ref Complex right)
 {
     return(new Vector2(left.X * right.Real + left.Y * right.Imaginary,
                        left.Y * right.Real - left.X * right.Imaginary));
 }
Exemple #8
0
 public static void Divide(ref Complex left, ref Complex right, out Complex result)
 {
     result = new Complex(right.Real * left.Real + right.Imaginary * left.Imaginary,
                          right.Real * left.Imaginary - right.Imaginary * left.Real);
 }