CVR-Lib last update 20 Sep 2009

Simple geometry classes and functions
[MathImage Processing and Analysis]

Collaboration diagram for Simple geometry classes and functions:

Modules

 Geometry Data Structures

Functions

template<class T >
bool cvr::intersection (const point< T > &p1, const point< T > &p2, const point< T > &p3, const point< T > &p4, point< T > &p)
template<class T >
bool cvr::intersection (const point< T > &p1, const point< T > &p2, const point< T > &p3, const point< T > &p4)
template<class T >
cvr::minDistanceSqr (const point< T > &p1, const point< T > &p2, const point< T > &p3, point< T > &p)
template<class T >
cvr::minDistanceSqr (const point< T > &p1, const point< T > &p2, const point< T > &p3)
template<class T >
cvr::minDistanceSqr (const point< T > &p1, const point< T > &p2, const point< T > &p3, const point< T > &p4, point< T > &pa, point< T > &pb)
template<class T >
int cvr::clockwiseTurn (const point< T > &p0, const point< T > &p1, const point< T > &p2)

Function Documentation

template<class T >
int cvr::clockwiseTurn ( const point< T > &  p0,
const point< T > &  p1,
const point< T > &  p2 
) [inline]

Turn orientation in a three-point path.

Compute if the path that follows the points p0, p1 and p2 makes a clock-wise turn (+1) a counter-clock-wise turn (-1) or stays in a straight line (0).

Parameters:
p0 first point
p1 second point
p2 third point
Returns:
+1 for a clockwise turn, -1 for a counter clockwise turn, 0 if path stays in a straight line.
Defined in cvrGeometry.h

template<class T >
bool cvr::intersection ( const point< T > &  p1,
const point< T > &  p2,
const point< T > &  p3,
const point< T > &  p4 
) [inline]

Line intersection.

Compute if the line between p1 and p2 intersects with the line between p3 and p4. If they intersect in exactly one point (normal case) the function returns true. If the lines are parallel or any of the lines have length 0 this function returns false.

Parameters:
p1 begin of first line
p2 end of first line
p3 begin of first line
p4 end of first line
Returns:
true if lines intersect in exactly one point, false otherwise
Defined in cvrGeometry.h

References cvr::intersection().

template<class T >
bool cvr::intersection ( const point< T > &  p1,
const point< T > &  p2,
const point< T > &  p3,
const point< T > &  p4,
point< T > &  p 
) [inline]

Line intersection.

Compute if the line between p1 and p2 intersects with the line between p3 and p4. If they intersect in exactly one point (normal case) the function returns true. If the lines are parallel or any of the lines have length 0 this function returns false.

Parameters:
p1 begin of first line
p2 end of first line
p3 begin of first line
p4 end of first line
p intersection point will be written here, in case there is one. if there is no intersection point (or infinity) the value will not change.
Returns:
true if lines intersect in exactly one point, false otherwise
Defined in cvrGeometry.h

Referenced by cvr::intersection().

template<class T >
T cvr::minDistanceSqr ( const point< T > &  p1,
const point< T > &  p2,
const point< T > &  p3,
const point< T > &  p4,
point< T > &  pa,
point< T > &  pb 
) [inline]

Distance between two line segments.

Compute the square of the minimal distance between the line segment defined by the points p1 and p2 and the line segment defined by the points p3 and p4. The corresponding points with the minimal distance will be stored in pa (in p1-p2) and pb (in p3-p4).

Parameters:
p1 start point of the first line segment
p2 end point of the first line segment
p3 start point of the second line segment
p4 end point of the second line segment
pa point in the line p1-p2 with the minimal distance to the line segment p3-p4.
pb point in the line p3-p4 with the minimal distance to the line segment p1-p2.
Returns:
the square of the distance between the line p1-p2 and p3-p4
Defined in cvrGeometry.h

template<class T >
T cvr::minDistanceSqr ( const point< T > &  p1,
const point< T > &  p2,
const point< T > &  p3 
) [inline]

Distance between line segment and point.

Compute the square of the minimal distance between the line segment defined by the points p1 and p2 and the point p3. The point within the line with the minimal distance will be stored in p.

Parameters:
p1 start point of the line segment
p2 end point of the line segment
p3 point, for which the distance to the line segment will be computed.
Returns:
the square of the distance between the line p1_p2 and the point p3
Defined in cvrGeometry.h

References cvr::minDistanceSqr().

template<class T >
T cvr::minDistanceSqr ( const point< T > &  p1,
const point< T > &  p2,
const point< T > &  p3,
point< T > &  p 
) [inline]

Distance between line segment and point.

Compute the square of the minimal distance between the line segment defined by the points p1 and p2 and the point p3. The point within the line with the minimal distance will be stored in p.

Parameters:
p1 start point of the line segment
p2 end point of the line segment
p3 point, for which the distance to the line segment will be computed.
p the point in the line between p1 and p2 with the shortest distance will be stored here.
Returns:
the square of the distance between the line p1_p2 and the point p3
Defined in cvrGeometry.h

Referenced by cvr::minDistanceSqr().


Generated on Sun Sep 20 22:08:33 2009 for CVR-Lib by Doxygen 1.5.8