00001 #ifndef CEP_INTERSECTION_SEGMENT_3_POINT_3_H
00002 #define CEP_INTERSECTION_SEGMENT_3_POINT_3_H
00003
00004 #include <CGAL/Object.h>
00005 #include <CGAL/Segment_3.h>
00006 #include <CGAL/Point_3.h>
00007 #include <CGAL/predicates_on_points_3.h>
00008
00009
00010 namespace CEP {
00011 namespace intersection {
00012
00013
00014 using CGAL::Segment_3;
00015 using CGAL::Point_3;
00016
00017
00019
00021 template <class R>
00022 inline
00023 bool
00024 do_intersect( const Segment_3<R>& s,
00025 const Point_3<R>& p )
00026 {
00027 return s.has_on(p);
00028 }
00029
00030
00032
00034 template <class R>
00035 inline
00036 CGAL::Object
00037 intersection( const Segment_3<R>& s,
00038 const Point_3<R>& p )
00039 {
00040 if ( do_intersect(s,p) )
00041 return CGAL::make_object(p);
00042 return CGAL::Object();
00043 }
00044
00045
00047 template <class R>
00048 inline
00049 bool
00050 collinear( const Segment_3<R>& s,
00051 const Point_3<R>& p )
00052 {
00053 return CGAL::collinear( s.source(), s.target(), p );
00054 }
00055
00056
00057
00058 }
00059 }
00060
00061 #endif