/
usr
/
include
/
boost
/
geometry
/
strategies
/
spherical
/
/usr/include/boost/geometry/strategies/spherical
mkdir
upload
Name
Size
Mode
Actions
area.hpp
4959
0644
edit
dl
rm
azimuth.hpp
3489
0644
edit
dl
rm
compare.hpp
9997
0644
edit
dl
rm
densify.hpp
4079
0644
edit
dl
rm
disjoint_box_box.hpp
4633
0644
edit
dl
rm
disjoint_segment_box.hpp
3588
0644
edit
dl
rm
distance_cross_track.hpp
27455
0644
edit
dl
rm
distance_cross_track_box_box.hpp
15443
0644
edit
dl
rm
distance_cross_track_point_box.hpp
13202
0644
edit
dl
rm
distance_haversine.hpp
9669
0644
edit
dl
rm
distance_segment_box.hpp
14187
0644
edit
dl
rm
envelope.hpp
4370
0644
edit
dl
rm
envelope_box.hpp
2130
0644
edit
dl
rm
envelope_multipoint.hpp
13234
0644
edit
dl
rm
envelope_point.hpp
3397
0644
edit
dl
rm
envelope_segment.hpp
14133
0644
edit
dl
rm
expand_box.hpp
5203
0644
edit
dl
rm
expand_point.hpp
8242
0644
edit
dl
rm
expand_segment.hpp
3435
0644
edit
dl
rm
get_radius.hpp
2109
0644
edit
dl
rm
index.hpp
6805
0644
edit
dl
rm
intersection.hpp
39856
0644
edit
dl
rm
io.hpp
1977
0644
edit
dl
rm
line_interpolate.hpp
3131
0644
edit
dl
rm
point_in_point.hpp
5771
0644
edit
dl
rm
point_in_poly_winding.hpp
21516
0644
edit
dl
rm
point_order.hpp
3787
0644
edit
dl
rm
side_by_cross_track.hpp
2864
0644
edit
dl
rm
ssf.hpp
5038
0644
edit
dl
rm
Edit:
/usr/include/boost/geometry/strategies/spherical/ssf.hpp
(5038B)
// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. // This file was modified by Oracle on 2016, 2018, 2019. // Modifications copyright (c) 2016-2019, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_SSF_HPP #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_SSF_HPP #include <boost/geometry/core/cs.hpp> #include <boost/geometry/core/access.hpp> #include <boost/geometry/core/radian_access.hpp> #include <boost/geometry/util/math.hpp> #include <boost/geometry/util/promote_floating_point.hpp> #include <boost/geometry/util/select_calculation_type.hpp> #include <boost/geometry/strategies/side.hpp> #include <boost/geometry/strategies/spherical/disjoint_segment_box.hpp> #include <boost/geometry/strategies/spherical/envelope.hpp> //#include <boost/geometry/strategies/concepts/side_concept.hpp> #include <boost/geometry/strategies/spherical/point_in_point.hpp> namespace boost { namespace geometry { namespace strategy { namespace side { #ifndef DOXYGEN_NO_DETAIL namespace detail { template <typename T> int spherical_side_formula(T const& lambda1, T const& delta1, T const& lambda2, T const& delta2, T const& lambda, T const& delta) { // Create temporary points (vectors) on unit a sphere T const cos_delta1 = cos(delta1); T const c1x = cos_delta1 * cos(lambda1); T const c1y = cos_delta1 * sin(lambda1); T const c1z = sin(delta1); T const cos_delta2 = cos(delta2); T const c2x = cos_delta2 * cos(lambda2); T const c2y = cos_delta2 * sin(lambda2); T const c2z = sin(delta2); // (Third point is converted directly) T const cos_delta = cos(delta); // Apply the "Spherical Side Formula" as presented on my blog T const dist = (c1y * c2z - c1z * c2y) * cos_delta * cos(lambda) + (c1z * c2x - c1x * c2z) * cos_delta * sin(lambda) + (c1x * c2y - c1y * c2x) * sin(delta); T zero = T(); return math::equals(dist, zero) ? 0 : dist > zero ? 1 : -1; // dist < zero } } #endif // DOXYGEN_NO_DETAIL /*! \brief Check at which side of a Great Circle segment a point lies left of segment (> 0), right of segment (< 0), on segment (0) \ingroup strategies \tparam CalculationType \tparam_calculation */ template <typename CalculationType = void> class spherical_side_formula { public : typedef spherical_tag cs_tag; typedef strategy::envelope::spherical<CalculationType> envelope_strategy_type; static inline envelope_strategy_type get_envelope_strategy() { return envelope_strategy_type(); } typedef strategy::disjoint::segment_box_spherical disjoint_strategy_type; static inline disjoint_strategy_type get_disjoint_strategy() { return disjoint_strategy_type(); } typedef strategy::within::spherical_point_point equals_point_point_strategy_type; static inline equals_point_point_strategy_type get_equals_point_point_strategy() { return equals_point_point_strategy_type(); } template <typename P1, typename P2, typename P> static inline int apply(P1 const& p1, P2 const& p2, P const& p) { typedef typename promote_floating_point < typename select_calculation_type_alt < CalculationType, P1, P2, P >::type >::type calculation_type; calculation_type const lambda1 = get_as_radian<0>(p1); calculation_type const delta1 = get_as_radian<1>(p1); calculation_type const lambda2 = get_as_radian<0>(p2); calculation_type const delta2 = get_as_radian<1>(p2); calculation_type const lambda = get_as_radian<0>(p); calculation_type const delta = get_as_radian<1>(p); return detail::spherical_side_formula(lambda1, delta1, lambda2, delta2, lambda, delta); } }; #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS namespace services { /*template <typename CalculationType> struct default_strategy<spherical_polar_tag, CalculationType> { typedef spherical_side_formula<CalculationType> type; };*/ template <typename CalculationType> struct default_strategy<spherical_equatorial_tag, CalculationType> { typedef spherical_side_formula<CalculationType> type; }; template <typename CalculationType> struct default_strategy<geographic_tag, CalculationType> { typedef spherical_side_formula<CalculationType> type; }; } #endif }} // namespace strategy::side }} // namespace boost::geometry #endif // BOOST_GEOMETRY_STRATEGIES_SPHERICAL_SSF_HPP
Save
cmd:
run