]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/test/strategies/projected_point_ax.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / geometry / test / strategies / projected_point_ax.cpp
CommitLineData
7c673cae
FG
1// Boost.Geometry (aka GGL, Generic Geometry Library)
2// Unit Test
3
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.
7
8// This file was modified by Oracle on 2014.
9// Modifications copyright (c) 2014, Oracle and/or its affiliates.
10
11// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
13
14// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
15// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
16
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)
20
21
22#include <strategies/test_projected_point.hpp>
23
24
25template <typename P1, typename P2>
26void test_all_2d_ax()
27{
28 typedef bg::strategy::distance::detail::projected_point_ax<> strategy_type;
29 typedef bg::strategy::distance::detail::projected_point_ax
30 <
31 void,
32 bg::strategy::distance::comparable::pythagoras<>
33 > comparable_strategy_type;
34
35 typedef typename strategy_type::result_type<P1, P2>::type result_type;
36
37 strategy_type strategy;
38 comparable_strategy_type comparable_strategy;
92f5a8d4 39 boost::ignore_unused(strategy, comparable_strategy);
7c673cae
FG
40
41 test_2d<P1, P2>("POINT(1 1)", "POINT(0 0)", "POINT(2 3)",
42 result_type(0, 0.27735203958327),
43 result_type(0, 0.27735203958327 * 0.27735203958327),
44 strategy, comparable_strategy);
45
46 test_2d<P1, P2>("POINT(2 2)", "POINT(1 4)", "POINT(4 1)",
47 result_type(0, 0.5 * sqrt(2.0)),
48 result_type(0, 0.5),
49 strategy, comparable_strategy);
50
51 test_2d<P1, P2>("POINT(6 1)", "POINT(1 4)", "POINT(4 1)",
52 result_type(sqrt(2.0), sqrt(2.0)),
53 result_type(2.0, 2.0),
54 strategy, comparable_strategy);
55
56 test_2d<P1, P2>("POINT(1 6)", "POINT(1 4)", "POINT(4 1)",
57 result_type(sqrt(2.0), sqrt(2.0)),
58 result_type(2.0, 2.0),
59 strategy, comparable_strategy);
60}
61
62template <typename P>
63void test_all_2d_ax()
64{
65 test_all_2d_ax<P, bg::model::point<int, 2, bg::cs::cartesian> >();
66 test_all_2d_ax<P, bg::model::point<float, 2, bg::cs::cartesian> >();
67 test_all_2d_ax<P, bg::model::point<double, 2, bg::cs::cartesian> >();
68 test_all_2d_ax<P, bg::model::point<long double, 2, bg::cs::cartesian> >();
69}
70
71int test_main(int, char* [])
72{
73 test_all_2d_ax<bg::model::point<int, 2, bg::cs::cartesian> >();
74 test_all_2d_ax<bg::model::point<float, 2, bg::cs::cartesian> >();
75 test_all_2d_ax<bg::model::point<double, 2, bg::cs::cartesian> >();
76
7c673cae
FG
77 return 0;
78}