public override Complex Div(Complex z) { CartesianComplex w = new CartesianComplex(this.re * z.Re + this.im * z.Im, this.im * z.Re - this.re * z.Im); w.re /= z.Norm(); w.im /= z.Norm(); return(w); }
static void Main(string[] args) { Complex z, w; z = new CartesianComplex(1, 1); w = new CartesianComplex(0, 1); Show(z, w); // Cartesian 同士 z = new PolarComplex(Math.Sqrt(2), Math.PI / 4); Show(z, w); // Polar と Cartesian w = new PolarComplex(1, Math.PI / 2); Show(z, w); // Polar 同士 z = new CartesianComplex(1, 1); Show(z, w); // Cartesian と Polar } //Main
static void Main(string[] args) { Complex z, w; z = new CartesianComplex(1, 1); w = new CartesianComplex(0, 1); Show(z, w); // Cartesian 同士 z = new PolarComplex(Math.Sqrt(2), Math.PI/4); Show(z, w); // Polar と Cartesian w = new PolarComplex(1, Math.PI/2); Show(z, w); // Polar 同士 z = new CartesianComplex(1, 1); Show(z, w); // Cartesian と Polar }//Main
public override Complex Div(Complex z) { CartesianComplex w = new CartesianComplex(this.re * z.Re + this.im * z.Im, this.im * z.Re - this.re * z.Im); w.re /= z.Norm(); w.im /= z.Norm(); return w; }