public void Calculations(double nextLat, double nextLong) { lat2 = nextLat; long2 = nextLong; CalculationClass calculationClass = new CalculationClass(); Distance2 = calculationClass.DistanceBtwnTwoPnts(lat1, long1, lat2, long2); FinalDistance = FinalDistance + Distance2; Distance2 = 0; //Now the second point is the first one and we wait for the coordinates of the next point lat1 = lat2; long1 = long2; CurrentSpeed = calculationClass.currentSpeed(Distance2); TimerDistance.Text = "Distance: " + FinalDistance.ToString() + " Meters"; TimerCurSpeed.Text = "Speed: " + CurrentSpeed.ToString() + " Km/h"; TimerLabel.Text = hr.ToString() + " h: " + min.ToString() + " m: " + sec.ToString() + " s"; }
public void ResetValues() { // Reset all values and labels for next run. hr = 0; min = 0; sec = 0; Distance2 = 0; FinalDistance = 0; FinalSpeed = 0; CurrentSpeed = 0; // ** TODO *** //DependencyService.Get<IMaphelper>().RemoveLines(); exerciseMap.RouteCoordinates.Clear(); TimerLabel.Text = hr.ToString() + " h: " + min.ToString() + " m: " + sec.ToString() + " s"; TimerDistance.Text = "Distance: " + FinalDistance.ToString() + " Meters"; TimerCurSpeed.Text = "Speed: " + CurrentSpeed.ToString() + " Km/h"; }