C# Class Mapsui.Geometries.Utilities.CGAlgorithms

Specifies and implements various fundamental Computational Geometric algorithms. The algorithms supplied in this class are robust for double-precision floating point.
Exibir arquivo Open project: pauldendulk/Mapsui

Public Methods

Method Description
ClosestPoint ( System.Point p, System.Point lineSegFrom, System.Point lineSegTo ) : System.Point

Computes the closest point on this line segment to another point.

DistanceLineLine ( System.Point a, System.Point b, System.Point c, System.Point d ) : double

Computes the distance from a line segment AB to a line segment CD. Note: NON-ROBUST!

DistancePointLine ( System.Point p, System.Point a, System.Point b ) : double

Computes the distance from a point p to a line segment AB. Note: NON-ROBUST!

DistancePointLinePerpendicular ( System.Point p, System.Point a, System.Point b ) : double

Computes the perpendicular distance from a point p to the (infinite) line containing the points AB

Length ( IList pts ) : double

Computes the length of a linestring specified by a sequence of points.

Project ( System.Point p, System.Point lineSegFrom, System.Point lineSegTo ) : System.Point

Compute the projection of a point onto the line determined by this line segment. Note that the projected point may lie outside the line segment. If this is the case, the projection factor will lie outside the range [0.0, 1.0].

ProjectionFactor ( System.Point p, System.Point lineSegFrom, System.Point lineSegTo ) : double

Compute the projection factor for the projection of the point p onto this LineSegment. The projection factor is the constant k by which the vector for this segment must be multiplied to equal the vector for the projection of p.

SignedArea ( System.Point ring ) : double

Returns the signed area for a ring. The area is positive ifthe ring is oriented CW.

Method Details

ClosestPoint() public static method

Computes the closest point on this line segment to another point.
public static ClosestPoint ( System.Point p, System.Point lineSegFrom, System.Point lineSegTo ) : System.Point
p System.Point
lineSegFrom System.Point
lineSegTo System.Point
return System.Point

DistanceLineLine() public static method

Computes the distance from a line segment AB to a line segment CD. Note: NON-ROBUST!
public static DistanceLineLine ( System.Point a, System.Point b, System.Point c, System.Point d ) : double
a System.Point A point of one line.
b System.Point The second point of the line (must be different to A).
c System.Point One point of the line.
d System.Point Another point of the line (must be different to A).
return double

DistancePointLine() public static method

Computes the distance from a point p to a line segment AB. Note: NON-ROBUST!
public static DistancePointLine ( System.Point p, System.Point a, System.Point b ) : double
p System.Point The point to compute the distance for.
a System.Point One point of the line.
b System.Point Another point of the line (must be different to A).
return double

DistancePointLinePerpendicular() public static method

Computes the perpendicular distance from a point p to the (infinite) line containing the points AB
public static DistancePointLinePerpendicular ( System.Point p, System.Point a, System.Point b ) : double
p System.Point The point to compute the distance for.
a System.Point One point of the line.
b System.Point Another point of the line (must be different to A).
return double

Length() public static method

Computes the length of a linestring specified by a sequence of points.
public static Length ( IList pts ) : double
pts IList The points specifying the linestring.
return double

Project() public static method

Compute the projection of a point onto the line determined by this line segment. Note that the projected point may lie outside the line segment. If this is the case, the projection factor will lie outside the range [0.0, 1.0].
public static Project ( System.Point p, System.Point lineSegFrom, System.Point lineSegTo ) : System.Point
p System.Point
lineSegFrom System.Point
lineSegTo System.Point
return System.Point

ProjectionFactor() public static method

Compute the projection factor for the projection of the point p onto this LineSegment. The projection factor is the constant k by which the vector for this segment must be multiplied to equal the vector for the projection of p.
public static ProjectionFactor ( System.Point p, System.Point lineSegFrom, System.Point lineSegTo ) : double
p System.Point
lineSegFrom System.Point
lineSegTo System.Point
return double

SignedArea() public static method

Returns the signed area for a ring. The area is positive ifthe ring is oriented CW.
public static SignedArea ( System.Point ring ) : double
ring System.Point
return double