public static PolarComplex potenciacion(PolarComplex num, int potencia) { var newMod = Math.Pow(num.mod, potencia); var newArg = llevarAPrimerGiro(num.arg * potencia); return(new PolarComplex(Math.Round(newMod, 2), Math.Round(newArg, 2))); }
private void Polarbinom_btn_Click(object sender, EventArgs e) { respolarbinom_entry.Text = ""; if (Functions.textboxCompletos(this)) { if (Functions.textbox_soloNum(mod_entry) && Functions.textbox_soloNum(arg_entry)) { PolarComplex num = new PolarComplex(double.Parse(mod_entry.Text), double.Parse(arg_entry.Text)); BinomialComplex numconvertido = num.convertirEnBinomica(); respolarbinom_entry.Text = numconvertido.mostrar(); return; } else { MessageBox.Show("Ingreso no vĂ¡lido", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } else { MessageBox.Show("Debe completar los campos solicitados", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
public static List <PolarComplex> radicacion(PolarComplex num, double raiz) { List <PolarComplex> li = new List <PolarComplex>(); for (int i = 0; i < raiz; i++) { double newMod = Math.Round(Math.Pow(num.mod, 1 / raiz), 2); double newArg = Math.Round((num.arg + (2 * Math.Round(Math.PI, 2) * i)) / raiz, 2); li.Add(new PolarComplex(newMod, newArg)); } return(li); }