2 #ifndef vgl_homg_line_3d_2_points_h_ 3 #define vgl_homg_line_3d_2_points_h_ 17 # include <vcl_msvc_warnings.h> 72 return dir/static_cast<Type>(dir.length());}
88 #define l vgl_homg_line_3d_2_points<Type> 93 inline bool is_ideal(
l const& line, Type tol=(Type)0)
94 {
return line.ideal(tol); }
101 {
return collinear(l1.point_finite(),l1.point_infinite(),p); }
105 template <
class Type>
107 {
return coplanar(l1.point_finite(),l1.point_infinite(),l2.point_finite(),l2.point_infinite()); }
111 template <
class Type>
117 template <
class Type>
119 {
return coplanar(l1.point_finite(),l1.point_infinite(),p1,p2); }
123 template <
class Type>
127 if (
collinear(l1,p)) p = l2.point_infinite();
135 template <
class Type>
140 template <
class Type>
153 template <
class Type>
154 std::ostream &
operator<<(std::ostream&s,
l const& p);
158 template <
class Type>
163 #define VGL_HOMG_LINE_3D_2_POINTS_INSTANTIATE(T) extern "please include vgl/vgl_homg_line_3d_2_points.hxx first" 165 #endif // vgl_homg_line_3d_2_points_h_ point in projective 3D space
vgl_homg_line_3d_2_points(const vgl_homg_line_3d_2_points< Type > &that)
Copy constructor.
vgl_homg_point_3d< Type > point_infinite_
the (unique) point at infinity.
bool ideal(Type tol=(Type) 0) const
Return true iff line is at infinity.
bool concurrent(l const &l1, l const &l2, l const &l3)
Are three lines concurrent, i.e., do they pass through a common point?.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
Represents a homogeneous 3D point.
void force_point2_infinite(void) const
force the point point_infinite_ to infinity, without changing the line.
vgl_vector_3d< Type > direction() const
The point at infinity defines the direction of the line.
bool collinear(l const &l1, vgl_homg_point_3d< Type > const &p)
Does a line pass through a point, i.e., are the point and the line collinear?.
vgl_homg_point_3d< Type > point_finite_
Any finite point on the line.
bool is_ideal(l const &line, T tol=(T) 0)
Return true iff line is the line at infinity.
bool coplanar(l const &l1, l const &l2)
Are two lines coplanar, i.e., do they intersect?.
vgl_homg_line_3d_2_points(void)
Default constructor with (0,0,0,1) and (1,0,0,0), which is the line y=z=0.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
bool operator==(vgl_homg_line_3d_2_points< Type > const &l) const
comparison.
vgl_homg_point_3d< Type > intersection(l const &l1, l const &l2)
Return the intersection point of two concurrent lines.
bool operator!=(vgl_homg_line_3d_2_points< Type > const &l) const
vgl_homg_point_3d< Type > point_finite() const
Finite point (Could be an ideal point, if the whole line is at infinity.).
void set(vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2)
Assignment.
vgl_homg_point_3d< Type > point_infinite() const
Infinite point: the intersection of the line with the plane at infinity.
Represents a homogeneous 3D line using two points.
vgl_homg_line_3d_2_points(vgl_homg_point_3d< Type > const &point_1, vgl_homg_point_3d< Type > const &point_2)
Construct from two points.