#include "vgl_point_3d.h"
#include <vgl/vgl_homg_point_3d.h>
#include <vgl/vgl_plane_3d.h>
#include <vgl/vgl_homg_plane_3d.h>
#include <vgl/vgl_tolerance.txx>
#include <vcl_iostream.h>
#include <vcl_iomanip.h>
#include <vcl_cmath.h>
Go to the source code of this file.
Defines | |
#define | vgl_point_3d_txx_ |
#define | vgl_sqr(x) double((x)*(x)) |
#define | VGL_POINT_3D_INSTANTIATE(T) |
Functions | |
template<class Type > | |
bool | coplanar (vgl_point_3d< Type > const &p1, vgl_point_3d< Type > const &p2, vgl_point_3d< Type > const &p3, vgl_point_3d< Type > const &p4) |
Return true iff the 4 points are coplanar, i.e., they belong to a common plane. | |
template<class T > | |
double | cross_ratio (vgl_point_3d< T >const &p1, vgl_point_3d< T >const &p2, vgl_point_3d< T >const &p3, vgl_point_3d< T >const &p4) |
cross ratio of four collinear points. | |
template<class Type > | |
vcl_ostream & | operator<< (vcl_ostream &s, vgl_point_3d< Type > const &p) |
Write "<vgl_point_3d x,y,z> " to stream. | |
template<class Type > | |
vcl_istream & | operator>> (vcl_istream &is, vgl_point_3d< Type > &p) |
Read from stream, possibly with formatting. | |
template<class Type > | |
double | stddev (vcl_vector< vgl_point_3d< Type > > const &v) |
Return the "average deviation" of a set of given points from its centre of gravity. |
Definition in file vgl_point_3d.txx.
#define VGL_POINT_3D_INSTANTIATE | ( | T | ) |
template class vgl_point_3d<T >; \ template double cross_ratio(vgl_point_3d<T >const&, vgl_point_3d<T >const&, \ vgl_point_3d<T >const&, vgl_point_3d<T >const&); \ template bool coplanar(vgl_point_3d<T > const&, vgl_point_3d<T > const&, \ vgl_point_3d<T > const&, vgl_point_3d<T > const&); \ template vcl_ostream& operator<<(vcl_ostream&, const vgl_point_3d<T >&); \ template vcl_istream& operator>>(vcl_istream&, vgl_point_3d<T >&); \ template double stddev(vcl_vector<vgl_point_3d<T > > const&)
Definition at line 150 of file vgl_point_3d.txx.
#define vgl_point_3d_txx_ |
Definition at line 3 of file vgl_point_3d.txx.
#define vgl_sqr | ( | x | ) | double((x)*(x)) |
bool coplanar | ( | vgl_point_3d< Type > const & | p1, |
vgl_point_3d< Type > const & | p2, | ||
vgl_point_3d< Type > const & | p3, | ||
vgl_point_3d< Type > const & | p4 | ||
) |
Return true iff the 4 points are coplanar, i.e., they belong to a common plane.
Definition at line 46 of file vgl_point_3d.txx.
double cross_ratio | ( | vgl_point_3d< T >const & | p1, |
vgl_point_3d< T >const & | p2, | ||
vgl_point_3d< T >const & | p3, | ||
vgl_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 67 of file vgl_point_3d.txx.
vcl_ostream& operator<< | ( | vcl_ostream & | s, |
vgl_point_3d< Type > const & | p | ||
) |
Write "<vgl_point_3d x,y,z> " to stream.
Definition at line 83 of file vgl_point_3d.txx.
vcl_istream& operator>> | ( | vcl_istream & | is, |
vgl_point_3d< Type > & | p | ||
) |
Read from stream, possibly with formatting.
Either just reads three blank-separated numbers, or reads three comma-separated numbers, or reads three numbers in parenthesized form "(123, 321, 567)"
Definition at line 124 of file vgl_point_3d.txx.
double stddev | ( | vcl_vector< vgl_point_3d< Type > > const & | v | ) |
Return the "average deviation" of a set of given points from its centre of gravity.
"Average" in the sense of the standard deviation (2-norm, i.e., square root of sum of squares) of the distances from that centre of gravity.
Definition at line 134 of file vgl_point_3d.txx.