Exemplo n.º 1
0
        private long CalculatePredictionAccuracyInMeter(double actualLat, double actualLon, double predictedLat, double predictedLon)
        {
            double actualX    = geoTransform.LongitudeToX(actualLon);
            double predictedX = geoTransform.LongitudeToX(predictedLon);
            double actualY    = geoTransform.LatitudeToY(actualLat);
            double predictedY = geoTransform.LatitudeToY(predictedLat);

            return((long)Math.Sqrt(
                       Math.Pow(Math.Abs(actualX - predictedX), 2) +
                       Math.Pow(Math.Abs(actualY - predictedY), 2)));
        }
Exemplo n.º 2
0
        private long GetTripDistance(RoutePredictionValidation validation)
        {
            double startX = geoTransform.LongitudeToX(validation.StartLon);
            double endX   = geoTransform.LongitudeToX(validation.ActualEndLon);
            double startY = geoTransform.LatitudeToY(validation.StartLat);
            double endY   = geoTransform.LatitudeToY(validation.ActualEndLat);

            return((long)Math.Sqrt(
                       Math.Pow(Math.Abs(startX - endX), 2) +
                       Math.Pow(Math.Abs(startY - endY), 2)));
        }