Macros | Functions
vgl_homg_point_3d.hxx File Reference
#include <iostream>
#include "vgl_homg_point_3d.h"
#include <vgl/vgl_homg_plane_3d.h>

Go to the source code of this file.

Macros

#define VGL_HOMG_POINT_3D_INSTANTIATE(T)
 

Functions

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 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 >
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...
 

Macro Definition Documentation

◆ VGL_HOMG_POINT_3D_INSTANTIATE

#define VGL_HOMG_POINT_3D_INSTANTIATE (   T)
Value:
template class vgl_homg_point_3d<T >; \
template std::ostream& operator<<(std::ostream&, vgl_homg_point_3d<T >const&); \
template std::istream& operator>>(std::istream&, vgl_homg_point_3d<T >&)
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.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
Represents a homogeneous 3D point.
Definition: vgl_fwd.h:9
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::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.

Definition at line 98 of file vgl_homg_point_3d.hxx.

Function Documentation

◆ collinear()

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?.

Definition at line 41 of file vgl_homg_point_3d.hxx.

◆ cross_ratio()

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.

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.

Definition at line 66 of file vgl_homg_point_3d.hxx.

◆ operator<<()

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.

Definition at line 81 of file vgl_homg_point_3d.hxx.

◆ operator>>()

template<class Type >
std::istream& operator>> ( std::istream &  s,
vgl_homg_point_3d< Type > &  p 
)

Read x y z w from stream.

Definition at line 89 of file vgl_homg_point_3d.hxx.