#pragma once #include #include #include #include #include namespace scwx { namespace qt { namespace util { namespace GeographicLib { /** * Get the default geodesic for the WGS84 ellipsoid. * * @return WGS84 ellipsoid geodesic */ const ::GeographicLib::Geodesic& DefaultGeodesic(); /** * Determine if an area/ring, oriented in either direction, contains a point. A * point lying on the area boundary is considered to be inside the area. * * @param [in] area A vector of Coordinates representing the area * @param [in] point The point to check against the area * * @return true if point is inside the area */ bool AreaContainsPoint(const std::vector& area, const common::Coordinate& point); /** * Get the angle between two points. * * @param [in] lat1 latitude of point 1 (degrees) * @param [in] lon1 longitude of point 1 (degrees) * @param [in] lat2 latitude of point 2 (degrees) * @param [in] lon2 longitude of point 2 (degrees) * * @return angle between point 1 and point 2 */ units::angle::degrees GetAngle(double lat1, double lon1, double lat2, double lon2); /** * Get a coordinate from a polar coordinate offset. * * @param [in] center The center coordinate from which the angle and distance * are given * @param [in] angle The angle at which the destination coordinate lies * @param [in] distance The distance from the center coordinate to the * destination coordinate * * @return offset coordinate */ common::Coordinate GetCoordinate(const common::Coordinate& center, units::angle::degrees angle, units::length::meters distance); /** * Get a coordinate from an (i, j) offset. * * @param [in] center The center coordinate from which i and j are offset * @param [in] i The easting offset in meters * @param [in] j The northing offset in meters * * @return offset coordinate */ common::Coordinate GetCoordinate(const common::Coordinate& center, units::meters i, units::meters j); /** * Get the distance between two points. * * @param [in] lat1 latitude of point 1 (degrees) * @param [in] lon1 longitude of point 1 (degrees) * @param [in] lat2 latitude of point 2 (degrees) * @param [in] lon2 longitude of point 2 (degrees) * * @return distance between point 1 and point 2 */ units::length::meters GetDistance(double lat1, double lon1, double lat2, double lon2); /** * Get the distance from an area to a point. If the area is less than a quarter * radius of the Earth away, this is the closest distance between the area and * the point. Otherwise it is the distance from the centroid of the area to the * point. Finally, if the point is in the area, it is always 0. * * @param [in] area A vector of Coordinates representing the area * @param [in] point The point to check against the area * * @return true if area is inside the radius of the point */ units::length::meters GetDistanceAreaPoint(const std::vector& area, const common::Coordinate& point); /** * Determine if an area/ring, oriented in either direction, is within a * distance of a point. A point lying on the area boundary is considered to be * inside the area, and thus always in range. Any part of the area being inside * the radius counts as inside. Uses GetDistanceAreaPoint to get the distance. * * @param [in] area A vector of Coordinates representing the area * @param [in] point The point to check against the area * @param [in] distance The max distance in meters * * @return true if area is inside the radius of the point */ bool AreaInRangeOfPoint(const std::vector& area, const common::Coordinate& point, const units::length::meters distance); /** * Get the altitude of the radar beam at a given distance, elevation and height * * @param [in] range The range to the radar site * @param [in] elevation The elevation of the radar site * @param [in] height The height of the radar site * * @return The altitude of the radar at that range */ units::length::meters GetRadarBeamAltititude(units::length::meters range, units::angle::degrees elevation, units::length::meters height); } // namespace GeographicLib } // namespace util } // namespace qt } // namespace scwx