/* * Copyright (c) 2019 Clementine Computing LLC. * * This file is part of PopuFare. * * PopuFare is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PopuFare is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with PopuFare. If not, see . * */ #include #include #include #include "../common/gpsmath.h" void usage(FILE *fp) { fprintf(fp, "\nusage:\n\n"); fprintf(fp, " gpsdist "); fprintf(fp, "\n\n"); } int main(int argc, char **argv) { float lat0, lon0, lat1, lon1; float dist; if (argc < 5) { usage(stderr); exit(-1); } lat0 = atof(argv[1]); lon0 = atof(argv[2]); lat1 = atof(argv[3]); lon1 = atof(argv[4]); dist = GPS_Dist(lat0, lon0, lat1, lon1); printf("Distance = %f meters\n", dist); }