|
| | vgl_homg_point_3d () |
| | Default constructor with (0,0,0,1). More...
|
| |
| | vgl_homg_point_3d (Type px, Type py, Type pz, Type pw=(Type) 1) |
| | Construct from three (nonhomogeneous) or four (homogeneous) Types. More...
|
| |
| | vgl_homg_point_3d (const Type v[4]) |
| | Construct from homogeneous 4-array. More...
|
| |
| | vgl_homg_point_3d (vgl_vector_3d< Type >const &v) |
| | Construct point at infinity from direction vector. More...
|
| |
| | vgl_homg_point_3d (vgl_point_3d< Type > const &p) |
| | Construct from (non-homogeneous) vgl_point_3d<Type>. More...
|
| |
| | vgl_homg_point_3d (vgl_homg_plane_3d< Type > const &l1, vgl_homg_plane_3d< Type > const &l2, vgl_homg_plane_3d< Type > const &l3) |
| | Construct from 3 planes (intersection). More...
|
| |
| bool | operator== (vgl_homg_point_3d< Type > const &other) const |
| | the comparison operator. More...
|
| |
| bool | operator!= (vgl_homg_point_3d< Type >const &other) const |
| |
| Type | x () const |
| |
| Type | y () const |
| |
| Type | z () const |
| |
| Type | w () const |
| |
| void | set (Type px, Type py, Type pz, Type pw=(Type) 1) |
| | Set x,y,z,w. More...
|
| |
| void | set (Type const p[4]) |
| |
| bool | ideal (Type tol=(Type) 0) const |
| | Return true iff the point is at infinity (an ideal point). More...
|
| |
| bool | get_nonhomogeneous (double &vx, double &vy, double &vz) const |
| |
| bool | rescale_w (Type new_w=Type(1)) |
| |
|
(Note that these are not member functions.)
|
| template<class T > |
| vgl_homg_point_3d< T > | vgl_closest_point_origin (vgl_homg_plane_3d< T > const &pl) |
| | Return the point on the given plane closest to the origin. More...
|
| |
| template<class T > |
| vgl_homg_point_3d< T > | vgl_closest_point_origin (vgl_homg_line_3d_2_points< T > const &l) |
| | Return the point on the given line closest to the origin. More...
|
| |
| template<class T > |
| vgl_homg_point_3d< T > | vgl_closest_point (vgl_homg_line_3d_2_points< T > const &l, vgl_homg_point_3d< T > const &p) |
| | Return the point on the given line which is closest to the given point. More...
|
| |
| template<class T > |
| double | vgl_distance (vgl_homg_point_3d< T >const &p1, vgl_homg_point_3d< T >const &p2) |
| | return the distance between two points. More...
|
| |
| template<class Type > |
| 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?. More...
|
| |
| template<class Type > |
| bool | coplanar (l const &l1, vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2) |
| | Are two points coplanar with a line?. More...
|
| |
| template<class Type > |
| std::ostream & | operator<< (std::ostream &s, vgl_homg_point_3d< Type > const &p) |
| | Write "<vgl_homg_point_3d (x,y,z,w) >" to stream. More...
|
| |
| template<class Type > |
| std::istream & | operator>> (std::istream &s, vgl_homg_point_3d< Type > &p) |
| | Read x y z w from stream. More...
|
| |
| template<class Type > |
| bool | is_ideal (vgl_homg_point_3d< Type > const &p, Type tol=(Type) 0) |
| | Return true iff the point is at infinity (an ideal point). More...
|
| |
| template<class Type > |
| bool | coplanar (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2, vgl_homg_point_3d< Type > const &p3, vgl_homg_point_3d< Type > const &p4) |
| | Return true iff the 4 points are coplanar, i.e., they belong to a common plane. More...
|
| |
| template<class Type > |
| vgl_vector_3d< Type > | operator- (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2) |
| | The difference of two points is the vector from second to first point. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > | operator+ (vgl_homg_point_3d< Type > const &p, vgl_vector_3d< Type > const &v) |
| | Adding a vector to a point gives a new point at the end of that vector. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > & | operator+= (vgl_homg_point_3d< Type > &p, vgl_vector_3d< Type > const &v) |
| | Adding a vector to a point gives the point at the end of that vector. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > | operator- (vgl_homg_point_3d< Type > const &p, vgl_vector_3d< Type > const &v) |
| | Subtracting a vector from a point is the same as adding the inverse vector. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > & | operator-= (vgl_homg_point_3d< Type > &p, vgl_vector_3d< Type > const &v) |
| | Subtracting a vector from a point is the same as adding the inverse vector. More...
|
| |
| template<class T > |
| double | cross_ratio (vgl_homg_point_3d< T >const &p1, vgl_homg_point_3d< T >const &p2, vgl_homg_point_3d< T >const &p3, vgl_homg_point_3d< T >const &p4) |
| | cross ratio of four collinear points. More...
|
| |
| template<class Type > |
| bool | collinear (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2, vgl_homg_point_3d< Type > const &p3) |
| | Are three points collinear, i.e., do they lie on a common line?. More...
|
| |
| template<class Type > |
| double | ratio (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2, vgl_homg_point_3d< Type > const &p3) |
| | Return the relative distance to p1 wrt p1-p2 of p3. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > | midpoint (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2, Type f=(Type) 0.5) |
| | Return the point at a given ratio wrt two other points. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > | centre (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2) |
| | Return the point at the centre of gravity of two given points. More...
|
| |
| template<class Type > |
| vgl_homg_point_3d< Type > | centre (std::vector< vgl_homg_point_3d< Type > > const &v) |
| | Return the point at the centre of gravity of a set of given points. More...
|
| |
template<class Type>
class vgl_homg_point_3d< Type >
Represents a homogeneous 3D point.
Definition at line 9 of file vgl_fwd.h.
cross ratio of four collinear points.
This number is projectively invariant, and it is the coordinate of p4 in the reference frame where p2 is the origin (coordinate 0), p3 is the unity (coordinate 1) and p1 is the point at infinity. This cross ratio is often denoted as ((p1, p2; p3, p4)) (which also equals ((p3, p4; p1, p2)) or ((p2, p1; p4, p3)) or ((p4, p3; p2, p1)) ) and is calculated as
p1 - p3 p2 - p3 (p1-p3)(p2-p4)
------- : -------- = --------------
p1 - p4 p2 - p4 (p1-p4)(p2-p3) If three of the given points coincide, the cross ratio is not defined.
In this implementation, a least-squares result is calculated when the points are not exactly collinear.