1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
8 // This file was modified by Oracle on 2014.
9 // Modifications copyright (c) 2014, Oracle and/or its affiliates.
11 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
14 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
15 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
17 // Use, modification and distribution is subject to the Boost Software License,
18 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
19 // http://www.boost.org/LICENSE_1_0.txt)
22 #include <strategies/test_projected_point.hpp>
25 template <typename P1
, typename P2
>
28 typedef bg::strategy::distance::detail::projected_point_ax
<> strategy_type
;
29 typedef bg::strategy::distance::detail::projected_point_ax
32 bg::strategy::distance::comparable::pythagoras
<>
33 > comparable_strategy_type
;
35 typedef typename
strategy_type::result_type
<P1
, P2
>::type result_type
;
37 strategy_type strategy
;
38 comparable_strategy_type comparable_strategy
;
39 boost::ignore_unused(strategy
);
40 boost::ignore_unused(comparable_strategy
);
42 test_2d
<P1
, P2
>("POINT(1 1)", "POINT(0 0)", "POINT(2 3)",
43 result_type(0, 0.27735203958327),
44 result_type(0, 0.27735203958327 * 0.27735203958327),
45 strategy
, comparable_strategy
);
47 test_2d
<P1
, P2
>("POINT(2 2)", "POINT(1 4)", "POINT(4 1)",
48 result_type(0, 0.5 * sqrt(2.0)),
50 strategy
, comparable_strategy
);
52 test_2d
<P1
, P2
>("POINT(6 1)", "POINT(1 4)", "POINT(4 1)",
53 result_type(sqrt(2.0), sqrt(2.0)),
54 result_type(2.0, 2.0),
55 strategy
, comparable_strategy
);
57 test_2d
<P1
, P2
>("POINT(1 6)", "POINT(1 4)", "POINT(4 1)",
58 result_type(sqrt(2.0), sqrt(2.0)),
59 result_type(2.0, 2.0),
60 strategy
, comparable_strategy
);
66 test_all_2d_ax
<P
, bg::model::point
<int, 2, bg::cs::cartesian
> >();
67 test_all_2d_ax
<P
, bg::model::point
<float, 2, bg::cs::cartesian
> >();
68 test_all_2d_ax
<P
, bg::model::point
<double, 2, bg::cs::cartesian
> >();
69 test_all_2d_ax
<P
, bg::model::point
<long double, 2, bg::cs::cartesian
> >();
72 int test_main(int, char* [])
74 test_all_2d_ax
<bg::model::point
<int, 2, bg::cs::cartesian
> >();
75 test_all_2d_ax
<bg::model::point
<float, 2, bg::cs::cartesian
> >();
76 test_all_2d_ax
<bg::model::point
<double, 2, bg::cs::cartesian
> >();
78 #if defined(HAVE_TTMATH)
81 bg::model::point
<ttmath_big
, 2, bg::cs::cartesian
>,
82 bg::model::point
<ttmath_big
, 2, bg::cs::cartesian
>