2 #ifndef vgl_1d_basis_hxx_ 3 #define vgl_1d_basis_hxx_ 9 # include <vcl_msvc_warnings.h> 14 : origin_(o), unity_(u), inf_pt_(i), affine_(false)
16 assert(
collinear(o,i,u) && o!=i && o!=u && i!=u);
21 : origin_(o), unity_(u), affine_(true)
31 double d =
ratio(origin_,unity_,p);
36 if (p == inf_pt_)
return {1,0};
45 s <<
"<vgl_1d_basis "<< b.
origin() <<
' ' << b.
unity();
51 #undef VGL_1D_BASIS_INSTANTIATE 52 #define VGL_1D_BASIS_INSTANTIATE(T) \ 53 template class vgl_1d_basis<T >;\ 54 template std::ostream& operator<<(std::ostream&, vgl_1d_basis<T > const&) 56 #endif // vgl_1d_basis_hxx_
vgl_homg_point_1d< double > project(T const &p)
Projection from a point in the source space to a 1-D homogeneous point.
storage for 3 collinear points to serve as 1-D projective basis
double cross_ratio(vgl_homg_point_1d< T >const &p1, vgl_homg_point_1d< T >const &p2, vgl_homg_point_1d< T >const &p3, vgl_homg_point_1d< T >const &p4)
cross ratio of four points.
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?.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
Storage for 3 collinear points to serve as 1-D projective basis.
double ratio(vgl_homg_point_1d< T > const &p1, vgl_homg_point_1d< T > const &p2, vgl_homg_point_1d< T > const &p3)
Return the relative distance to p1 wrt p1-p2 of p3.
bool is_ideal(l const &line, T tol=(T) 0)
Return true iff line is the line at infinity.
Represents a homogeneous 1-D point, i.e., a homogeneous pair (x,w).