Summary
A double-precision class encapsulating a straight line segment connecting two points.
Constructors
| Initialises a line segment using the specified start and end point. |
EdgeD(double x1, double y1, double x2, double y2) | Initialises a line segment using the start point (X1, Y1) and the end point (X2, Y2). |
|
Initialises a line segment starting at the specified point. The ending point is 1 unit away at the specified
angle. |
Instance methods
bool | |
Returns true if the specified point lies exactly on this edge. Accurate results are not guaranteed on edges
which are not axis-aligned. |
double | |
Returns the Z component of the cross product of this edge, treated as a vector from EdgeD.Start to
EdgeD.End, with a vector from EdgeD.Start to the specified point. |
double | |
Returns the Z component of the cross product of this edge, treated as a vector, with the specified edge, also
treated as a vector. |
double | |
Calculates the distance between the specified point and the extended straight line identified by this edge. |
bool | |
Compares two EdgeD ignoring direction: edges are considered equal as long as they have the same
endpoints. |
bool | |
Compares two EdgeD objects for equality. |
int | | Returns a hash code for the current EdgeD. |
bool | |
Determines whether two edges intersect. |
double | |
Calculates the projection of the specified point onto the line defined by this edge. Returns the Lambda of
this point P, defined by P = Start + Lambda * (End - Start). Hence the lambda is 0 if the projection falls
exactly onto the Start point, and 1 if it falls on the End point. |
PointD | | Returns a point on this edge that is as near as possible to the specified point. |
string | |
Provides a string representation of the current EdgeD. |
Operators
bool | |
Compares two EdgeD ignoring direction: edges are considered equal as long as they have the same
endpoints. |
bool | |
Instance properties
double | | Returns the angle between the x-axis and this edge, in radians. |
double | | Returns the angle between the x-axis and this edge, in degrees. |
double | | Returns the difference in the Y-co-ordinates of the start and end point of this EdgeD. |
double | | Returns the length of this edge (the distance between EdgeD.Start and EdgeD.End). |
PointD | | Returns the point located halfway along this edge. |
double | | Returns the difference in the X-co-ordinates of the start and end point of this EdgeD. |
Instance fields
PointD | | End point of the line segment. |
PointD | | Start point of the line segment. |