@@ -0,0 +1,1441 @@
+package com.andela.motustracker.model;%0A%0A/**%0A * Created by Spykins on 10/04/16.%0A */%0Apublic class DistanceCalculator %7B%0A    private double latitude, longitude;%0A%0A    public DistanceCalculator(double latitude, double longitude) %7B%0A        this.latitude = round(latitude, 6);%0A        this.longitude = round(longitude, 6);%0A    %7D%0A%0A    public double getDistance(double latitude2, double longitude2) %7B%0A%0A        latitude2 = round(latitude2, 6);%0A        longitude2 = round(longitude2, 5);%0A%0A        final int earthRadius = 6375000;%0A%0A        Double latDistance = toRad(latitude2 - latitude);%0A        Double lonDistance = toRad(longitude2 - longitude);%0A        Double haversineFomular = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) +%0A                Math.cos(toRad(latitude)) * Math.cos(toRad(latitude2)) *%0A                        Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);%0A        Double bearing = 2 * Math.atan2(Math.sqrt(haversineFomular), Math.sqrt(1 - haversineFomular));%0A        Double distance = earthRadius * bearing;%0A%0A        return distance;%0A    %7D%0A%0A    private static Double toRad(Double value) %7B%0A        return value * Math.PI / 180;%0A    %7D%0A%0A    private double round(double value, int places) %7B%0A        if (places %3C 0) throw new IllegalArgumentException();%0A%0A        long factor = (long) Math.pow(10, places);%0A        value = value * factor;%0A        long tmp = Math.round(value);%0A        return (double) tmp / factor;%0A    %7D%0A%0A%7D%0A

Create DistanceCalculator to help implement the distance between coordinates