MCPcopy Create free account
hub / github.com/comaps/comaps / make_section_longer

Function make_section_longer

libs/geometry/geometry_tests/intersect_test.cpp:27–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void make_section_longer(m2::PointD & p1, m2::PointD & p2, double sm)
28{
29 if (p1.x == p2.x)
30 {
31 if (p1.y > p2.y)
32 sm = -sm;
33
34 p1.y -= sm;
35 p2.y += sm;
36 }
37 else if (p1.y == p2.y)
38 {
39 if (p1.x > p2.x)
40 sm = -sm;
41
42 p1.x -= sm;
43 p2.x += sm;
44 }
45 else
46 {
47 double const az = ang::AngleTo(p1, p2);
48 p1.Move(-sm, az);
49 p2.Move(sm, az);
50 }
51}
52
53template <class TComp>
54void check_full_equal(m2::RectD const & r, m2::PointD const & p1, m2::PointD const & p2, TComp comp)

Callers 1

check_full_equalFunction · 0.85

Calls 2

AngleToFunction · 0.85
MoveMethod · 0.45

Tested by

no test coverage detected