|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
The class Line2dPPC represents a oriented line segment
in 2d Euclidian space. The line segment is determined by
two distinct points. The line segment has got all properties
of the line passing through the end points.
Derived Classes:
Variables:
- Point2dC pointA;
-
The start point.
- Point2dC pointB;
-
The end point.
Methods:
- Line2dPPC()
-
Creates a default non-existing line. It must be used only for
initialization of arrays.
- Line2dPPC(const Point2dC & a,const Point2dC & b)
-
The line which is determined by the start point 'a' and
the end point 'b'.
- Line2dPPC(const Point2dC & a,const Vector2dC & v)
-
The line, which is determined by the start point 'a' and
the vector 'v'.
- Line2dPPC(const Line2dPPC & line)
-
Copy constructor.
Access to the elements of the object.
-------------------------------------
- const Point2dC & FirstPoint() const
-
Returns the start point.
- const Point2dC & SecondPoint() const
-
Returns the end point.
- Point2dC & FirstPoint()
-
Returns the start point.
- Point2dC & SecondPoint()
-
Returns the end point.
- const Point2dC & operator[](const IndexT i) const
-
Returns the ith point.
- Point2dC & operator[](const IndexT i)
-
Returns the ith point.
- Vector2dC Vector() const
-
Returns the vector from the start point to the end point.
- Vector2dC Normal() const
-
Returns the vector perpendicular to the direction of this line.
The normal vector is counter-clockwise rotated about PI/2 according
to the direction of the line.
- RealT GetX(RealT y) const
-
Returns the x coordinate of the point on the line
if the y coordinate is known.
- RealT GetY(RealT x) const
-
Returns the y coordinate of the point on the line
if the x coordinate is known.
- Point2dC PointT(RealT t) const
-
Returns the point of the line which is determined as A+(B-A) * t,
where A is the start point of the line and B is the end point
of the line.
- void Swap()
-
Swaps the end points of this
- Line2dPPC Swapped() const
-
Returns a line with swapped endpoints
- Line2dPPC operator*(const RealT & x) const
-
Returns line whose endpoint coordinates are scaled by x
- RealT Length() const
-
Returns the length of the line (i.e. Euclidean distance between
endpoints)
Geometrical constructions.
--------------------------
- RealT ParIntersection(const Line2dPPC & l) const
-
Returns the parameter of the intersection according to this line.
If the parameter is equal to 0, the intersection is the starting
point of this line, if the parameter is 1, the intersection is the
end point. If the parameter is between 0 and 1 the intersection is
inside of this line segment.
- BooleanT HasInnerIntersection(const Line2dPPC & l) const
-
Returns TRUE if the intersection of this line segment and the
line 'l' is either inside of this line segment or one of the end points.
- Point2dC Intersection(const Line2dPPC & line) const
-
Returns the intersection of 2 lines.
- RealT SqrEDistance(const Point2dC & point) const
-
Returns the squared Euclidian distance of the 'point' from the line.
- RealT SDistance(const Point2dC & point) const
-
Returns the signed distance of the 'point' from the line.
The return value is greater than 0 if the point is on the left
side of the line. The left side of the line is determined
by the vector of the line.
- RealT Distance(const Point2dC & point) const
-
Returns the distance of the 'point' from the line.
- Point2dC Projection(const Point2dC & point) const
-
Returns the point which is the orthogonal projection of the 'point'
to the line. It is the same as intersection of this line with
the perpendicular line passing through the 'point'.
- istream & operator>>(istream & inS,Line2dPPC & line)
-
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|