Esempio n. 1
0
 std::size_t hash_value(const CGAL::Point_2<Kernel>& point)
 {
   std::size_t seed = 0;
   boost::hash_combine(seed, to_double(point.x()));
   boost::hash_combine(seed, to_double(point.y()));
   return seed;
 }
Esempio n. 2
0
 arma::vec3
 toArmaVec3(const CGAL::Point_2< K> & vec)
 {
   arma::vec3 v;
   v(0) = CGAL::to_double(vec.x());
   v(1) = CGAL::to_double(vec.y());
   v(2) = 0.0;
   return v;
 }
Esempio n. 3
0
// get the point position on segment
// in [0,1] if its on the interior
static Kernel::FT point_position( const CGAL::Segment_2<Kernel>& seg, const CGAL::Point_2<Kernel>& pt )
{
    CGAL::Point_2<Kernel> pA = seg.source();
    CGAL::Point_2<Kernel> pB = seg.target();
    Kernel::FT num = pt.x() - pA.x();
    Kernel::FT den = pB.x() - pA.x();

    if ( den == 0 ) {
        num = pt.y() - pA.y();
        den = pB.y() - pA.y();
    }

    return num / den;
}
void print_point ( CGAL::Point_2<K> const& p )
{
  std::cout << "(" << p.x() << "," << p.y() << ")" ;
}
Esempio n. 5
0
 FT
 operator () (const CGAL::Point_2<K> &p) const
 {
   return _a * p.x() + _b * p.y() + _c;
 }
void print_point ( CGAL::Point_2<K> const& p )
{
  //CGAL::exact(p);
  std::cout <<  p.x() << " " << p.y();
}