| 64 | } |
| 65 | |
| 66 | UNIT_TEST(PointToPolygon_GeneralProperties) |
| 67 | { |
| 68 | m2::PointD constexpr center(0.0, 0.0); |
| 69 | double constexpr r = 10.0; |
| 70 | |
| 71 | std::array<double, 4> const anglesDeg{0.0, -30.0, 30.0, 45.0}; |
| 72 | |
| 73 | for (double const & angleDeg : anglesDeg) |
| 74 | { |
| 75 | for (size_t verticesCount = 3; verticesCount < 30; ++verticesCount) |
| 76 | { |
| 77 | std::vector<m2::PointD> const circlePlain = PointToPolygon(center, r, verticesCount, angleDeg); |
| 78 | double const vertexLenght = DistanceOnPlain(circlePlain.front(), circlePlain.back()); |
| 79 | |
| 80 | for (size_t i = 0; i < circlePlain.size() - 1; ++i) |
| 81 | { |
| 82 | double const rCurrent = DistanceOnPlain(circlePlain[i], center); |
| 83 | TEST(AlmostEqualAbs(rCurrent, r, kMwmPointAccuracy), ()); |
| 84 | |
| 85 | double const vertexLengthCurrent = DistanceOnPlain(circlePlain[i], circlePlain[i + 1]); |
| 86 | TEST(AlmostEqualAbs(vertexLengthCurrent, vertexLenght, kMwmPointAccuracy), ()); |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | UNIT_TEST(TrimSegment_Vertical) |
| 93 | { |
nothing calls this directly
no test coverage detected