#include <points.H>
Inheritance diagram for mlib::Wline:
Public Member Functions | |
Line () | |
Default constructor. Creates a line with the results of the default constructors for the point and vector classes used. | |
Line (const Wpt &p, const Wvec &v) | |
Constructor that creates a line containing the point p and moving along the direction of vector v . Alternately creates a line segment with p as one endpoint and ( p + v ) as the other endpoint. | |
Line (const Wpt &p1, const Wpt &p2) | |
Constructor that creates the line going through points p1 and p2 . Alternately creates a line segment with endpoints p1 and p2 . | |
const Wpt & | point () const |
Wpt & | point () |
const Wvec & | vector () const |
Wvec & | vector () |
bool | is_valid () const |
Is the line valid (i.e. has a vector with non-zero length). | |
Wpt | endpt () const |
Returns the second endpoint of the line when treated as a line segment. | |
Wpt | midpt () const |
Returns the midpoint of the line when treated as a line segment. | |
double | length () const |
Returns the length of the line when treated as a line segment. | |
bool | operator== (const Line< Wline, Wpt, Wvec > &l) const |
Are the two line's points and vectors exactly equal? | |
double | dist (const Wpt &p) const |
Returns the distance from the point to the line. | |
Wpt | project (const Wpt &p) const |
Returns closest point on line to given point p. | |
Wpt | project_to_seg (const Wpt &p) const |
Finds the nearest point on this line segment to the given point. | |
Wpt | project_to_seg (const Wline &l) const |
Finds the nearest point on this line segment to the given line. | |
Wpt | reflection (const Wpt &p) const |
Wpt | intersect (const Wline &l) const |
Returns the closest point on this line to the given line l. | |
bool | intersect_segs (const Wline &l, Wpt &inter) const |
Returns true if this line, treated as a segment, intersects the given line, also treated as a segment. | |
bool | intersect_segs (const Wline &l) const |
Same as Line<L,P,V>::intersect_segLine(const L& l, P& inter) except without the argument to return the intersection point. | |
bool | intersect_seg_line (const Wline &l, Wpt &inter) const |
Returns true if this line, treated as a segment, intersects the given line, also treated as a line. | |
Constructors | |
Wline () | |
Wline (CWpt &p, CWvec &v) | |
Wline (CWpt &p1, CWpt &p2) | |
Wline (CXYpt &x) | |
Protected Attributes | |
Wpt | _point |
Wvec | _vector |
Definition at line 288 of file points.H.
|
|
|
|
|
|
|
|
|
Returns the distance from the point to the line. If vector is null (line is not valid) returns distance to _point. |
|
Returns the second endpoint of the line when treated as a line segment.
|
|
Returns the closest point on this line to the given line l. For 3D lines it's rare that the 2 lines actually intersect, so this is not really named well. |
|
Returns true if this line, treated as a segment, intersects the given line, also treated as a line. On success, also fills in the intersection point. |
|
Same as Line<L,P,V>::intersect_segLine(const L& l, P& inter) except without the argument to return the intersection point.
|
|
Returns true if this line, treated as a segment, intersects the given line, also treated as a segment. On success, also fills in the intersection point. |
|
Is the line valid (i.e. has a vector with non-zero length).
|
|
Returns the length of the line when treated as a line segment.
|
|
Constructor that creates the line going through points
|
|
Constructor that creates a line containing the point
|
|
Default constructor. Creates a line with the results of the default constructors for the point and vector classes used. This most likely creates an invalid line (i.e. has a zero length vector) at the origin. |
|
Returns the midpoint of the line when treated as a line segment.
|
|
Are the two line's points and vectors exactly equal?
|
|
|
|
|
|
Returns closest point on line to given point p. If vector is null (line is not valid) returns _point. |
|
Finds the nearest point on this line segment to the given line. If this line is invalid, returns first endpoint. |
|
Finds the nearest point on this line segment to the given point. If this line is invalid, returns first endpoint. |
|
|
|
|
|
|
|
|
|
|