title: Calculate large distance between two points using GeoTools
body: <p>New to GeoTools and GIS and I am trying to calculate distance between Mumbai and Durban using GeoTools library. I am getting close to accurate results for small distances but when i go for bigger ones,the calculation is way too offcourse by 2000 km, i dont completely understand the CRS system .Below is my Code to calculate the distance between Mumbai and Durban</p>
  
  <pre><code>    Coordinate source = new Coordinate(19.0760, 72.8777);   ///Mumbai Lat Long
      Coordinate destination1 = new Coordinate(-29.883333, 31.049999); //Durban Lat Long
  
      GeometryFactory geometryFactory = new GeometryFactory();
      Geometry point1 = geometryFactory.createPoint(source);
      Geometry point2 = geometryFactory.createPoint(destination1);
  
      CoordinateReferenceSystem auto = auto = CRS.decode("AUTO:42001,13.45,52.3");
      MathTransform transform = CRS.findMathTransform(DefaultGeographicCRS.WGS84, auto);
  
      Geometry g3 = JTS.transform(point1, transform);
      Geometry g4 = JTS.transform(point2, transform);
  
      double distance = g3.distance(g4);
  </code></pre>