本文整理汇总了C++中Strategy::radius方法的典型用法代码示例。如果您正苦于以下问题:C++ Strategy::radius方法的具体用法?C++ Strategy::radius怎么用?C++ Strategy::radius使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strategy
的用法示例。
在下文中一共展示了Strategy::radius方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
static inline void apply(std::string const& case_id,
std::string const& wkt1,
std::string const& wkt2,
std::string const& feature1,
std::string const& feature2,
features_type ftype,
Strategy const& strategy)
{
double const radius = strategy.radius();
double expected_distance, expected_comparable_distance;
if (ftype == pp)
{
expected_distance = distance_pp(feature1, feature2, radius);
expected_comparable_distance
= comparable_distance_pp(feature1, feature2);
}
else
{
expected_distance = distance_ps(feature1, feature2, radius);
expected_comparable_distance
= comparable_distance_ps(feature1, feature2);
}
apply(case_id, wkt1, wkt2,
expected_distance, expected_comparable_distance,
strategy);
}
示例2: test_distance_point_point
void test_distance_point_point(Strategy const& strategy,
bool is_comparable_strategy = false)
{
#ifdef BOOST_GEOMETRY_TEST_DEBUG
std::cout << std::endl;
std::cout << "point/point distance tests" << std::endl;
#endif
typedef test_distance_of_geometries<point_type, point_type> tester;
tester::apply("p-p-01",
"POINT(10 10)",
"POINT(0 0)",
(is_comparable_strategy
? 0.0150768448035229
: (0.24619691677893202 * strategy.radius())),
0.0150768448035229,
strategy);
tester::apply("p-p-02",
"POINT(10 10)",
"POINT(10 10)",
0,
strategy);
// antipodal points
tester::apply("p-p-03",
"POINT(0 10)",
"POINT(180 -10)",
(is_comparable_strategy
? 1.0
: (180.0 * bg::math::d2r * strategy.radius())),
1.0,
strategy);
tester::apply("p-p-04",
"POINT(0 0)",
"POINT(180 0)",
(is_comparable_strategy
? 1.0
: (180.0 * bg::math::d2r * strategy.radius())),
1.0,
strategy);
}
示例3: test_distance_point_box
void test_distance_point_box(Strategy const& strategy)
{
#ifdef BOOST_GEOMETRY_TEST_DEBUG
std::cout << std::endl;
std::cout << "point/box distance tests" << std::endl;
#endif
typedef test_distances<point_type, box_type> tester;
double const radius = strategy.radius();
double const d2r = bg::math::d2r<double>();
// Cases for relative location of a point wrt to a box
//
// | |
// | 3 |
// | |
// +---------+
// | |
// 1 | 5 | 2
// | |
// +---------+
// | |
// | 4 |
// | |
//
// and also the following cases
//
// | |
// A B
// | |
// +----C----+
// | |
// D E
// | |
// +----F----+
// | |
// G H
// | |
//
// and finally we have the corners
//
// | |
// | |
// | |
// a---------b
// | |
// | |
// | |
// c---------d
// | |
// | |
// | |
//
// for each relative position we also have to test the shifted point
// (this is due to the fact that boxes have longitudes in the
// range [-180, 540)
std::string const box1 = "BOX(10 10,20 20)";
// case 1
tester::apply("pb1-1a", "POINT(5 25)", box1,
"POINT(5 25)", "POINT(10 20)", pp,
strategy);
// case 1
tester::apply("pb1-1b", "POINT(3 12)", box1,
"POINT(3 12)", "SEGMENT(10 10,10 20)", ps,
strategy);
// case 1
tester::apply("pb1-1c", "POINT(3 17)", box1,
"POINT(3 17)", "SEGMENT(10 10,10 20)", ps,
strategy);
// case 1
tester::apply("pb1-1d", "POINT(5 4)", box1,
"POINT(5 4)", "POINT(10 10)", pp,
strategy);
// case 1
tester::apply("pb1-1e", "POINT(-100 20)", box1,
"POINT(-100 20)", "POINT(10 20)", pp,
strategy);
// case 1
tester::apply("pb1-1g", "POINT(-100 10)", box1,
"POINT(-100 10)", "SEGMENT(10 10,10 20)", ps,
strategy);
// case 2
tester::apply("pb1-2a", "POINT(31 25)", box1,
"POINT(31 25)", "POINT(20 20)", pp,
strategy);
// case 2
tester::apply("pb1-2b", "POINT(23 17)", box1,
"POINT(23 17)", "SEGMENT(20 10,20 20)", ps,
strategy);
// case 2
//.........这里部分代码省略.........