Welcome to mirror list, hosted at ThFree Co, Russian Federation.

segment2d.hpp « geometry - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e77857ee19c7d19faa1ab096de450391f2c12ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "geometry/point2d.hpp"

#include <string>

namespace m2
{
struct Segment2D
{
  Segment2D() = default;
  Segment2D(PointD const & u, PointD const & v) : m_u(u), m_v(v) {}

  PointD const Dir() const { return m_v - m_u; }

  PointD m_u;
  PointD m_v;
};

std::string DebugPrint(Segment2D const & s);

bool IsPointOnSegmentEps(PointD const & pt, PointD const & p1, PointD const & p2, double eps);
bool IsPointOnSegment(PointD const & pt, PointD const & p1, PointD const & p2);
}  // namespace m2