2 #ifndef vgl_homg_line_3d_2_points_hxx_ 3 #define vgl_homg_line_3d_2_points_hxx_ 11 # include <vcl_msvc_warnings.h> 29 if (!point_finite().ideal()) {
48 if (point_infinite_.w() < tol && point_infinite_.w()>-tol)
return;
49 else if (point_finite_.w() < tol && point_finite_.w()>-tol)
52 point_infinite_=point_finite_;
56 Type a=point_finite_.
x(), a1=point_infinite_.x(),
57 b=point_finite_.y(), b1=point_infinite_.y(),
58 c=point_finite_.z(), c1=point_infinite_.z(),
59 d=point_finite_.w(), d1=point_infinite_.w();
60 point_infinite_.set(a*d1-a1*d, b*d1-b1*d, c*d1-c1*d, 0);
72 Type t1 = b3*a1-a3*b1, t2 = (a2-a0)*b3-(b2-b0)*a3;
74 t1 = c3*a1-a3*c1, t2 = (a2-a0)*c3-(c2-c0)*a3;
76 t1 = d3*a1-a3*d1, t2 = (a2-a0)*d3-(d2-d0)*a3;
78 t1 = c3*b1-b3*c1, t2 = (b2-b0)*c3-(c2-c0)*b3;
80 t1 = d3*b1-b3*d1, t2 = (b2-b0)*d3-(d2-d0)*b3;
82 t1 = d3*c1-c3*d1, t2 = (c2-c0)*d3-(d2-d0)*c3;
94 return s <<
"<vgl_homg_line_3d_2_points " 98 #undef VGL_HOMG_LINE_3D_2_POINTS_INSTANTIATE 99 #define VGL_HOMG_LINE_3D_2_POINTS_INSTANTIATE(T) \ 100 template class vgl_homg_line_3d_2_points<T >;\ 101 template std::ostream& operator<<(std::ostream&, vgl_homg_line_3d_2_points<T > const&);\ 102 template vgl_homg_point_3d<T > intersection(vgl_homg_line_3d_2_points<T > const&, vgl_homg_line_3d_2_points<T > const&) 104 #endif // vgl_homg_line_3d_2_points_hxx_
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.
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?.
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.
vgl_homg_point_3d< Type > point_finite() const
Finite point (Could be an ideal point, if the whole line is at infinity.).
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.