#include <SegmentMath.h>
Inheritance diagram for geom::SegmentMath< N, T >:
Public Types | |
typedef Base::Number | Number |
The number type. | |
typedef Base::Point | Point |
The point type. | |
Public Member Functions | |
Constructors etc. | |
SegmentMath () | |
Default constructor. Uninitialized memory. | |
SegmentMath (const Point &source, const Point &target) | |
Construct from two points. | |
SegmentMath (const Segment< N, T > &s) | |
Construct from a Segment. | |
SegmentMath (const SegmentMath &other) | |
Copy constructor. | |
SegmentMath & | operator= (const SegmentMath &other) |
Assignment operator. | |
~SegmentMath () | |
Trivial destructor. | |
void | make (const Point &source, const Point &target) |
Make from two points. | |
Accesors. | |
const Point & | getTangent () const |
Return the unit tangent to the line segment. | |
T | getLength () const |
Return the length of the line segment. | |
Translations. | |
SegmentMath & | operator+= (const Point &p) |
Translate by p. | |
SegmentMath & | operator-= (const Point &p) |
Translate by -p. | |
Validity. | |
bool | isValid () const |
Return true if the segment is valid. | |
Related Functions | |
(Note that these are not member functions.) | |
const SegmentMath< N, T > & | operator+ (const SegmentMath< N, T > &x) |
Return the segment. | |
SegmentMath< N, T > | operator- (const SegmentMath< N, T > &x) |
Return a reversed segment. | |
SegmentMath< N, T > | operator+ (const SegmentMath< N, T > &s, const typename SegmentMath< N, T >::Point &p) |
Translate by p. | |
SegmentMath< N, T > | operator- (const SegmentMath< N, T > &s, const typename SegmentMath< N, T >::Point &p) |
Translate by -p. | |
bool | operator== (const SegmentMath< N, T > &x, const SegmentMath< N, T > &y) |
Return true if the segments are equal. | |
bool | operator!= (const SegmentMath< N, T > &x, const SegmentMath< N, T > &y) |
Return true if the segments are not equal. | |
T | computeDistance (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x) |
Compute the unsigned distance to the line segment. | |
void | computeClosestPoint (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x, typename SegmentMath< N, T >::Point *closestPoint) |
Compute closest point on the line segment. | |
T | computeDistanceAndClosestPoint (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x, typename SegmentMath< N, T >::Point *closestPoint) |
Compute the unsigned distance to the line segment and the closest point on it. | |
T | computeUnsignedDistanceToSupportingLine (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x) |
Compute the unsigned distance to the supporting line of the segment. | |
T | computeUnsignedDistanceAndClosestPointToSupportingLine (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x, typename SegmentMath< N, T >::Point *closestPoint) |
Compute the unsigned distance to the supporting line of the segment and the closest point on the line. | |
bool | computeZIntersection (const SegmentMath< 3, T > &segment, T *x, T *y, T z) |
Return true if the segment intersects the plane of constant z. | |
bool | computeIntersection (const SegmentMath< 2, T > &s1, const SegmentMath< 2, T > &s2, typename SegmentMath< 2, T >::Point *intersectionPoint) |
If the two Segments intersect, return true and the point of intersection. Otherwise return false. | |
std::istream & | operator>> (std::istream &in, SegmentMath< N, T > &s) |
File input. | |
std::ostream & | operator<< (std::ostream &out, const SegmentMath< N, T > &s) |
File output. |
N | is the dimension. | |
T | is the number type. By default it is double. |
bool computeZIntersection | ( | const SegmentMath< 3, T > & | segment, | |
T * | x, | |||
T * | y, | |||
T | z | |||
) | [related] |
Return true if the segment intersects the plane of constant z.
Set x and y to the point of intersection.