예제 #1
0
        public complex pow(uint pow)
        {
            complex cmplx = new complex();

            cmplx._real      = Math.Pow(this.norm(), pow) * Math.Cos(pow * this.angle());
            cmplx._imaginary = Math.Pow(this.norm(), pow) * Math.Sin(pow * this.angle());
            return(cmplx);
        }
예제 #2
0
        public static complex operator /(complex c1, complex c2)
        {
            complex cmplx = new complex();

            cmplx._real      = (c1._real * c2._real + c1._imaginary * c2._imaginary) / (Math.Pow(c2._real, 2) + Math.Pow(c2._imaginary, 2));
            cmplx._imaginary = (c1._imaginary * c2._real - c1._real * c2._imaginary) / (Math.Pow(c2._real, 2) + Math.Pow(c2._imaginary, 2));
            return(cmplx);
        }
예제 #3
0
        public complex conjugate()
        {
            complex cmplx = new complex();

            cmplx._real      = this._real;
            cmplx._imaginary = (-1) * this._imaginary;
            return(cmplx);
        }
예제 #4
0
        public static complex operator *(complex c1, complex c2)
        {
            complex cmplx = new complex();

            cmplx._real      = c1._real * c2._real - c1._imaginary * c2._imaginary;
            cmplx._imaginary = c1._imaginary * c2._real + c1._real * c2._imaginary;
            return(cmplx);
        }