reformat code source file

This commit is contained in:
Dennis Luxen 2015-01-22 16:33:27 +01:00
parent 3fa12445a5
commit 814d9aa01b
2 changed files with 19 additions and 19 deletions

View File

@ -39,6 +39,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace
{
constexpr static const float RAD = 0.017453292519943295769236907684886;
// earth radius varies between 6,356.750-6,378.135 km (3,949.901-3,963.189mi)
// The IUGG value for the equatorial radius is 6378.137 km (3963.19 miles)
constexpr static const float earth_radius = 6372797.560856f;
}
@ -64,10 +66,9 @@ double coordinate_calculation::great_circle_distance(const int lat1,
const double dLong = dlong1 - dlong2;
const double dLat = dlat1 - dlat2;
const double aHarv = pow(sin(dLat / 2.0), 2.0) + cos(dlat1) * cos(dlat2) * pow(sin(dLong / 2.), 2);
const double aHarv =
pow(sin(dLat / 2.0), 2.0) + cos(dlat1) * cos(dlat2) * pow(sin(dLong / 2.), 2);
const double cHarv = 2. * atan2(sqrt(aHarv), sqrt(1.0 - aHarv));
// earth radius varies between 6,356.750-6,378.135 km (3,949.901-3,963.189mi)
// The IUGG value for the equatorial radius is 6378.137 km (3963.19 miles)
return earth_radius * cHarv;
}

View File

@ -45,8 +45,7 @@ struct coordinate_calculation
static float euclidean_distance(const FixedPointCoordinate &first_coordinate,
const FixedPointCoordinate &second_coordinate);
static float
euclidean_distance(const int lat1, const int lon1, const int lat2, const int lon2);
static float euclidean_distance(const int lat1, const int lon1, const int lat2, const int lon2);
static void lat_or_lon_to_string(const int value, std::string &output);
@ -86,4 +85,4 @@ struct coordinate_calculation
static float rad_to_deg(const float radian);
};
#endif //COORDINATE_CALCULATION
#endif // COORDINATE_CALCULATION