예제 #1
0
        public static complexo operator /(complexo a, complexo b)
        {
            complexo temp = new complexo(0, 0);

            temp = (a * (~b)) / ((b * (~b)).real);
            return(temp);
        }
예제 #2
0
        public void trocaLinha(int linha1, int linha2)
        {
            complexo temp = new complexo(0, 0);

            for (int j = 0; j < this.colunas; j++)
            {
                temp.copiar(elementos[linha1][j]);
                this.elementos[linha1][j].copiar(this.elementos[linha2][j]);
                this.elementos[linha2][j].copiar(temp);
            }
        }
예제 #3
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            complexo objCom = obj as complexo;

            if (objCom.real == this.real && objCom.imaginario == this.imaginario)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #4
0
        public complexo Det()
        {
            complexo D = new complexo(0, 0);

            if (linhas == colunas)
            {
                if (linhas == 2)
                {
                    return(elementos[0][0] * elementos[1][1] - elementos[1][0] * elementos[0][1]);
                }
                else
                {
                    for (int i = 0; i < colunas; i++)
                    {
                        D += Math.Pow(-1, i) * elementos[0][i] * submatriz(0, i).Det();
                    }
                }
            }
            else//pseudodeterminante
            {
            }
            return(D);
        }
예제 #5
0
 public void copiar(complexo outro)
 {
     this.real       = outro.real;
     this.imaginario = outro.imaginario;
 }