当前位置: 首页>>代码示例>>C++>>正文


C++ Strategy::radius方法代码示例

本文整理汇总了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);
    }
开发者ID:LancelotGHX,项目名称:Simula,代码行数:28,代码来源:distance_se_point_box.cpp

示例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);
}
开发者ID:ash-github,项目名称:FatCat-Server,代码行数:41,代码来源:distance_se_pl_pl.cpp

示例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
//.........这里部分代码省略.........
开发者ID:LancelotGHX,项目名称:Simula,代码行数:101,代码来源:distance_se_point_box.cpp


注:本文中的Strategy::radius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。