public IActionResult Swing(string angle, string velocity) { double numAngle = 0; double numVelocity = 0; angle = angle.Replace(".", ","); velocity = velocity.Replace(".", ","); double.TryParse(angle, out numAngle); double.TryParse(velocity, out numVelocity); ViewBag.Distance = Golf.Distance(numAngle, numVelocity);//klass golf + method return(View()); }
public IActionResult Swing(string angle, string velocity) //public IActionResult Swing(double angle, double velocity) { double numAngle = 0; double numVelocity = 0; angle = angle.Replace('.', ','); velocity = velocity.Replace('.', ','); double.TryParse(angle, out numAngle); double.TryParse(velocity, out numVelocity); ViewBag.Distance = Golf.Distance(numAngle, numVelocity); return(View()); }