public ActionResult MetodoSecante(metodoSecante_model model, string submitbutton) { MetodoDeLaSecante metsec = new MetodoDeLaSecante(); model.ans = new Answer_Model(); metsec.function = model.function; metsec.XO = model.XO; metsec.Xl = model.X1; metsec.EPS = model.EPS; metsec.EPSI = Convert.ToDecimal(model.EPSI); metsec.MAXIT = model.MAXIT; model.ans.Res = metsec.solve(); if (model.ans.Res[0] == 'L') { model.ans.status = 1; } else { model.ans.status = 2; } return(View(model)); }
public ActionResult MetodoSecante() { metodoSecante_model model = new metodoSecante_model(); model.function = "x^3 + 2x^2 + 10x - 20"; model.XO = 0; model.X1 = 1; model.EPS = 0; model.EPSI = "0.001"; model.MAXIT = 4; MetodoDeLaSecante metsec = new MetodoDeLaSecante(); model.ans = new Answer_Model(); metsec.function = "x^3 + 2x^2 + 10x - 20"; metsec.XO = 0; metsec.Xl = 1; metsec.EPS = 0; metsec.EPSI = 0.001m; metsec.MAXIT = 4; model.ans.Res = metsec.solve(); model.ans.status = 0; return(View(model)); }