mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-27 05:02:17 +00:00
[strategies] [tests] Test degenerate pt/box and box/box cases; fix a bug in pt-sgmt distance strategy
This commit is contained in:
@@ -65,7 +65,8 @@ public :
|
||||
(math::equals(lat2, half_pi) && math::equals(lat1, -half_pi)) )
|
||||
{
|
||||
// single meridian not crossing pole
|
||||
res.distance = apply(lat2, spheroid) - apply(lat1, spheroid);
|
||||
res.distance = apply(lat2, spheroid)
|
||||
- apply(lat1, spheroid);
|
||||
res.meridian = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public :
|
||||
|
||||
template <typename CT>
|
||||
static inline CT apply(CT lon1, CT lat1, CT lon2, CT lat2,
|
||||
Spheroid const& spheroid) const
|
||||
Spheroid const& spheroid)
|
||||
{
|
||||
typedef typename formula::elliptic_arc_length
|
||||
<
|
||||
@@ -120,8 +120,8 @@ public :
|
||||
CT, strategy::default_order<FormulaPolicy>::value
|
||||
> elliptic_arc_length;
|
||||
|
||||
return elliptic_arc_length::apply(lat2, m_spheroid)
|
||||
- elliptic_arc_length::apply(lat1, m_spheroid);
|
||||
return math::abs(elliptic_arc_length::apply(lat2, m_spheroid)
|
||||
- elliptic_arc_length::apply(lat1, m_spheroid));
|
||||
}
|
||||
|
||||
inline Spheroid const& model() const
|
||||
|
||||
@@ -242,6 +242,12 @@ private :
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_GEOGRAPHIC_CROSS_TRACK
|
||||
std::cout << "Equatorial segment" << std::endl;
|
||||
std::cout << "segment=(" << lon1 * math::r2d<CT>();
|
||||
std::cout << "," << lat1 * math::r2d<CT>();
|
||||
std::cout << "),(" << lon2 * math::r2d<CT>();
|
||||
std::cout << "," << lat2 * math::r2d<CT>();
|
||||
std::cout << ")\np=(" << lon3 * math::r2d<CT>();
|
||||
std::cout << "," << lat3 * math::r2d<CT>() << ")\n";
|
||||
#endif
|
||||
if (lon3 <= lon1)
|
||||
{
|
||||
@@ -254,6 +260,11 @@ private :
|
||||
return non_iterative_case(lon3, lat1, lon3, lat3, spheroid);
|
||||
}
|
||||
|
||||
if ((lon1 == lon2 || math::equals(math::abs(diff), pi) )&& lat1 > lat2)
|
||||
{
|
||||
std::swap(lat1,lat2);
|
||||
}
|
||||
|
||||
if (math::equals(math::abs(diff), pi))
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_GEOGRAPHIC_CROSS_TRACK
|
||||
|
||||
@@ -198,7 +198,7 @@ template <typename Units, bool IsEquatorial>
|
||||
struct latitude_convert_if_polar
|
||||
{
|
||||
template <typename T>
|
||||
static inline void apply(T & lat) {}
|
||||
static inline void apply(T &) {}
|
||||
};
|
||||
|
||||
template <typename Units>
|
||||
|
||||
Reference in New Issue
Block a user