This Java program calculates the accurate distance between two points on the Earth's surface using the Vincenty formula. The Vincenty formula takes into account the Earth's oblate spheroid shape, providing more accurate results compared to the simple Haversine formula.
- Clone the repository or download the source code files.
- Open the project in your Java development environment.
- Run the
VincentyDistance.java
file.
The program will prompt you to enter the latitude and longitude values for two points. After providing the inputs, it will calculate and display the distance between the two points in kilometers.
- Java Development Kit (JDK) 8 or above.
The Vincenty formula is an algorithm used to calculate the distance between two points on an oblate spheroid. It takes into account the flattening of the Earth and provides more accurate results compared to the simpler Haversine formula. The formula involves iterative calculations to converge on the accurate distance.
- The program assumes input coordinates provided in decimal degrees.
- Proper validation and range checking should be implemented to handle invalid or out-of-range input values.
This project is licensed under the MIT License.