public ActionResult DiferenciacionNumerica() { DiferenciacionNumerica_Model mE = new DiferenciacionNumerica_Model(); mE.ans = new Answer_Model(); mE.n = 2; mE.xd=1.5; mE.ans.Res = "30"; return View(mE); }
public JsonResult DiferenciacionNumerica(DiferenciacionNumerica_Model model) { DiferenciacionNumerica dn = new DiferenciacionNumerica(); double[] list1 = new double[model.values.Count]; double[] list2 = new double[model.values.Count]; for (int i = 0; i < model.values.Count; i++) { list1[i] = (Double.Parse(model.values[i].y)); list2[i] = (Double.Parse(model.values[i].x)); } model.ans = new Answer_Model(); model.ans.Res = dn.Calcular(list2, list1,model.xd, model.n); if (model.ans.Res[0] == 'L') model.ans.status = 1; else model.ans.status = 2; return Json(model.ans); }