This project is a GPS calculator that reads coordinates from a file and calculates the distance between two points using the Vincenty formula. The coordinates are stored in a struct called Coord
and an auxiliary struct called Angle
. The main functions of the project are:
-
read_file(const char *file_name, Coord ***arr)
: This function reads the coordinates from a file and stores them in an array of pointers toCoord
structs. It returns the size of the array. -
vincenty(Coord *point1, Coord *point2)
: This function calculates the distance between two points using the Vincenty formula. It takes twoCoord
structs as input and returns the distance in kilometers.
The project also includes helper functions for reading and splitting strings, allocating and freeing memory, and converting angles to degrees.
To get started with this project, follow these steps:
-
Clone the repository to your local machine:
https://github.com/IgorDzilla/gps_calc/new/master?filename=README.md
-
Navigate to the project directory:
cd gps_calc
-
Compile the project using make:
make
-
Run the compiled program with a file containing coordinates:
./gps_calc coords.gcrd