Enhanced C#
Language of your choice: library documentation
|
Contains useful basic polygon algorithms: hit testing, area calculation, orientation detection. More...
Contains useful basic polygon algorithms: hit testing, area calculation, orientation detection.
Static Public Member Functions | |
static long | PolygonArea (IEnumerable< Point > polygon) |
Computes the area of a polygon. More... | |
static long | PolygonArea (IEnumerator< Point > e) |
static int | Orientation (IEnumerable< Point > poly) |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward. More... | |
static int | Orientation (IEnumerator< Point > poly) |
static bool | IsPointInPolygon (IEnumerable< Point > poly, Point p) |
Finds out if a point is inside the polygon using a winding test. More... | |
static bool | IsPointInPolygon (IEnumerator< Point > e, Point p) |
static int | GetWindingNumber (this IEnumerable< Point > poly, Point p) |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test. More... | |
static int | GetWindingNumber (this IEnumerator< Point > e, Point p) |
static float | PolygonArea (IEnumerable< Point > polygon) |
Computes the area of a polygon. More... | |
static float | PolygonArea (IEnumerator< Point > e) |
static int | Orientation (IEnumerable< Point > poly) |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward. More... | |
static int | Orientation (IEnumerator< Point > poly) |
static bool | IsPointInPolygon (IEnumerable< Point > poly, Point p) |
Finds out if a point is inside the polygon using a winding test. More... | |
static bool | IsPointInPolygon (IEnumerator< Point > e, Point p) |
static int | GetWindingNumber (this IEnumerable< Point > poly, Point p) |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test. More... | |
static int | GetWindingNumber (this IEnumerator< Point > e, Point p) |
static double | PolygonArea (IEnumerable< Point > polygon) |
Computes the area of a polygon. More... | |
static double | PolygonArea (IEnumerator< Point > e) |
static int | Orientation (IEnumerable< Point > poly) |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward. More... | |
static int | Orientation (IEnumerator< Point > poly) |
static bool | IsPointInPolygon (IEnumerable< Point > poly, Point p) |
Finds out if a point is inside the polygon using a winding test. More... | |
static bool | IsPointInPolygon (IEnumerator< Point > e, Point p) |
static int | GetWindingNumber (this IEnumerable< Point > poly, Point p) |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test. More... | |
static int | GetWindingNumber (this IEnumerator< Point > e, Point p) |
static FPL16 | PolygonArea (IEnumerable< Point > polygon) |
Computes the area of a polygon. More... | |
static FPL16 | PolygonArea (IEnumerator< Point > e) |
static int | Orientation (IEnumerable< Point > poly) |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward. More... | |
static int | Orientation (IEnumerator< Point > poly) |
static bool | IsPointInPolygon (IEnumerable< Point > poly, Point p) |
Finds out if a point is inside the polygon using a winding test. More... | |
static bool | IsPointInPolygon (IEnumerator< Point > e, Point p) |
static int | GetWindingNumber (this IEnumerable< Point > poly, Point p) |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test. More... | |
static int | GetWindingNumber (this IEnumerator< Point > e, Point p) |
static FPL32 | PolygonArea (IEnumerable< Point > polygon) |
Computes the area of a polygon. More... | |
static FPL32 | PolygonArea (IEnumerator< Point > e) |
static int | Orientation (IEnumerable< Point > poly) |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward. More... | |
static int | Orientation (IEnumerator< Point > poly) |
static bool | IsPointInPolygon (IEnumerable< Point > poly, Point p) |
Finds out if a point is inside the polygon using a winding test. More... | |
static bool | IsPointInPolygon (IEnumerator< Point > e, Point p) |
static int | GetWindingNumber (this IEnumerable< Point > poly, Point p) |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test. More... | |
static int | GetWindingNumber (this IEnumerator< Point > e, Point p) |
|
inlinestatic |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test.
The test point is considered to be within the polygon if it lies on a top or left edge, but not on a bottom or right edge (within the precision limits of 'double' arithmetic). The test point will never be considered inside a degenerate (zero-width) area.
References Loyc.Geometry.PolygonMath.GetWindingNumber().
Referenced by Loyc.Geometry.PolygonMath.GetWindingNumber().
|
inlinestatic |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test.
The test point is considered to be within the polygon if it lies on a top or left edge, but not on a bottom or right edge (within the precision limits of 'double' arithmetic). The test point will never be considered inside a degenerate (zero-width) area.
References Loyc.Geometry.PolygonMath.GetWindingNumber().
Referenced by Loyc.Geometry.PolygonMath.GetWindingNumber().
|
inlinestatic |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test.
The test point is considered to be within the polygon if it lies on a top or left edge, but not on a bottom or right edge (within the precision limits of 'double' arithmetic). The test point will never be considered inside a degenerate (zero-width) area.
References Loyc.Geometry.PolygonMath.GetWindingNumber().
Referenced by Loyc.Geometry.PolygonMath.GetWindingNumber().
|
inlinestatic |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test.
The test point is considered to be within the polygon if it lies on a top or left edge, but not on a bottom or right edge (within the precision limits of 'double' arithmetic). The test point will never be considered inside a degenerate (zero-width) area.
References Loyc.Geometry.PolygonMath.GetWindingNumber().
Referenced by Loyc.Geometry.PolygonMath.GetWindingNumber().
|
inlinestatic |
Counts the number of times the polygon winds around a test point, using a rightward raycasting test.
The test point is considered to be within the polygon if it lies on a top or left edge, but not on a bottom or right edge (within the precision limits of 'double' arithmetic). The test point will never be considered inside a degenerate (zero-width) area.
References Loyc.Geometry.PolygonMath.GetWindingNumber().
Referenced by Loyc.Geometry.PolygonMath.GetWindingNumber().
|
inlinestatic |
Finds out if a point is inside the polygon using a winding test.
|
inlinestatic |
Finds out if a point is inside the polygon using a winding test.
|
inlinestatic |
Finds out if a point is inside the polygon using a winding test.
|
inlinestatic |
Finds out if a point is inside the polygon using a winding test.
|
inlinestatic |
Finds out if a point is inside the polygon using a winding test.
|
inlinestatic |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward.
A common approach to this problem is to look at the topmost point and the two points on either side. However, if one is not careful, this technique may be unable to detect the orientation in case the polygon has duplicate points, horizontal lines on top, or a degenerate top in which the top part of the polygon is zero-width (these problems can occur even if the polygon's lines do not cross one another.) That's why I chose to compute orientation based on area instead.
|
inlinestatic |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward.
A common approach to this problem is to look at the topmost point and the two points on either side. However, if one is not careful, this technique may be unable to detect the orientation in case the polygon has duplicate points, horizontal lines on top, or a degenerate top in which the top part of the polygon is zero-width (these problems can occur even if the polygon's lines do not cross one another.) That's why I chose to compute orientation based on area instead.
|
inlinestatic |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward.
A common approach to this problem is to look at the topmost point and the two points on either side. However, if one is not careful, this technique may be unable to detect the orientation in case the polygon has duplicate points, horizontal lines on top, or a degenerate top in which the top part of the polygon is zero-width (these problems can occur even if the polygon's lines do not cross one another.) That's why I chose to compute orientation based on area instead.
|
inlinestatic |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward.
A common approach to this problem is to look at the topmost point and the two points on either side. However, if one is not careful, this technique may be unable to detect the orientation in case the polygon has duplicate points, horizontal lines on top, or a degenerate top in which the top part of the polygon is zero-width (these problems can occur even if the polygon's lines do not cross one another.) That's why I chose to compute orientation based on area instead.
|
inlinestatic |
Returns Math.Sign(PolygonArea(poly)): positive when clockwise and increasing Y goes upward.
A common approach to this problem is to look at the topmost point and the two points on either side. However, if one is not careful, this technique may be unable to detect the orientation in case the polygon has duplicate points, horizontal lines on top, or a degenerate top in which the top part of the polygon is zero-width (these problems can occur even if the polygon's lines do not cross one another.) That's why I chose to compute orientation based on area instead.
|
inlinestatic |
Computes the area of a polygon.
http://www.codeproject.com/Tips/601272/Calculating-the-area-of-a-polygon
References Loyc.Geometry.PolygonMath.PolygonArea().
Referenced by Loyc.Geometry.PolygonMath.PolygonArea().
|
inlinestatic |
Computes the area of a polygon.
http://www.codeproject.com/Tips/601272/Calculating-the-area-of-a-polygon
References Loyc.Geometry.PolygonMath.PolygonArea().
Referenced by Loyc.Geometry.PolygonMath.PolygonArea().
|
inlinestatic |
Computes the area of a polygon.
http://www.codeproject.com/Tips/601272/Calculating-the-area-of-a-polygon
References Loyc.Geometry.PolygonMath.PolygonArea().
Referenced by Loyc.Geometry.PolygonMath.PolygonArea().
|
inlinestatic |
Computes the area of a polygon.
http://www.codeproject.com/Tips/601272/Calculating-the-area-of-a-polygon
References Loyc.Geometry.PolygonMath.PolygonArea().
Referenced by Loyc.Geometry.PolygonMath.PolygonArea().
|
inlinestatic |
Computes the area of a polygon.
http://www.codeproject.com/Tips/601272/Calculating-the-area-of-a-polygon
References Loyc.Geometry.PolygonMath.PolygonArea().
Referenced by Loyc.Geometry.PolygonMath.PolygonArea().