Table of Contents

Struct GeoTriangle2

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

Represents a triangle in the plane, defined by three vertices.

A polygon or a face of the plane broken into triangles comes back as these, from TriangulateSurface() and its kin, and a triangle answers the questions every other shape of the plane does. It is GeoTriangle3 laid flat: three points always make a triangle, even one of no area, so nothing is checked at construction.

public readonly struct GeoTriangle2 : IEquatable<GeoTriangle2>
Implements
Inherited Members

Constructors

GeoTriangle2(GeoPoint2, GeoPoint2, GeoPoint2)

Initializes a new triangle from three vertices.

Properties

A

Gets the first vertex.

Area

Gets the area of the triangle, whichever way it runs.

B

Gets the second vertex.

C

Gets the third vertex.

Centroid

Gets the centroid of the triangle, where its three medians meet.

IsClockwise

Gets a value indicating whether the vertices run clockwise.

IsValid

Gets whether this is a shape a constructor could have made: every corner is a valid point.

this[int]

Gets the vertex at a given index, counted from zero.

Length

Gets the perimeter of the triangle.

MinAngle

Gets the smallest of the three angles, in radians: the one that says how thin a triangle is.

SignedArea

Gets the signed area of the triangle: positive when A, B, C run counter-clockwise, negative when they run clockwise.

Methods

Clone()

Creates a copy of this triangle.

CollidesWith(GeoArc2)

Checks whether this triangle touches an arc, using the default tolerance.

CollidesWith(GeoArc2, Tolerance)

Checks whether this triangle touches an arc, within a tolerance.

CollidesWith(GeoCircle2)

Checks whether this triangle touches a circle, using the default tolerance.

CollidesWith(GeoCircle2, Tolerance)

Checks whether this triangle touches a circle, within a tolerance.

CollidesWith(GeoEdge2)

Checks whether this triangle touches an edge, using the default tolerance.

CollidesWith(GeoEdge2, Tolerance)

Checks whether this triangle touches an edge, within a tolerance.

CollidesWith(GeoFace2)

Checks whether this triangle touches a face, using the default tolerance.

CollidesWith(GeoFace2, Tolerance)

Checks whether this triangle touches a face, within a tolerance.

CollidesWith(GeoLine2)

Checks whether this triangle touches a segment, using the default tolerance.

CollidesWith(GeoLine2, Tolerance)

Checks whether this triangle touches a segment, within a tolerance.

CollidesWith(GeoPolygon2)

Checks whether this triangle touches a polygon, using the default tolerance.

CollidesWith(GeoPolygon2, Tolerance)

Checks whether this triangle touches a polygon, within a tolerance.

CollidesWith(GeoPolygonArc2)

Checks whether this triangle touches a curved loop, using the default tolerance.

CollidesWith(GeoPolygonArc2, Tolerance)

Checks whether this triangle touches a curved loop, within a tolerance.

CollidesWith(GeoPolyline2)

Checks whether this triangle touches a polyline, using the default tolerance.

CollidesWith(GeoPolyline2, Tolerance)

Checks whether this triangle touches a polyline, within a tolerance.

CollidesWith(GeoPolylineArc2)

Checks whether this triangle touches a curved chain, using the default tolerance.

CollidesWith(GeoPolylineArc2, Tolerance)

Checks whether this triangle touches a curved chain, within a tolerance.

CollidesWith(GeoRectangle2)

Checks whether this triangle touches a rectangle, using the default tolerance.

CollidesWith(GeoRectangle2, Tolerance)

Checks whether this triangle touches a rectangle, within a tolerance.

CollidesWith(GeoTriangle2)

Checks whether this triangle touches another triangle, using the default tolerance.

CollidesWith(GeoTriangle2, Tolerance)

Checks whether this triangle touches another triangle, within a tolerance.

Contains(GeoLine2)

Checks whether this triangle holds a segment whole, its edges included, using the default tolerance.

Contains(GeoLine2, Tolerance)

Checks whether this triangle holds a segment whole, its edges included, within a tolerance.

Contains(GeoPoint2)

Checks whether a point lies inside this triangle or on its edges, using the default tolerance.

Contains(GeoPoint2, Tolerance)

Checks whether a point lies inside this triangle or on its edges, within a tolerance.

Contains(GeoPolyline2)

Checks whether this triangle holds a polyline whole, its edges included, using the default tolerance.

Contains(GeoPolyline2, Tolerance)

Checks whether this triangle holds a polyline whole, its edges included, within a tolerance.

DistanceTo(GeoArc2)

Gets the distance from this triangle to an arc, using the default tolerance.

DistanceTo(GeoArc2, Tolerance)

Gets the distance from this triangle to an arc, within a tolerance.

DistanceTo(GeoCircle2)

Gets the distance from this triangle to a circle.

DistanceTo(GeoEdge2)

Gets the distance from this triangle to an edge.

DistanceTo(GeoLine2)

Gets the distance from this triangle to a segment.

DistanceTo(GeoPoint2)

Gets the distance from this triangle to a point: nought for a point within it.

DistanceTo(GeoPolygon2)

Gets the distance from this triangle to a polygon.

DistanceTo(GeoPolygonArc2)

Gets the distance from this triangle to a curved loop, using the default tolerance.

DistanceTo(GeoPolygonArc2, Tolerance)

Gets the distance from this triangle to a curved loop, within a tolerance.

DistanceTo(GeoPolyline2)

Gets the distance from this triangle to a polyline.

DistanceTo(GeoPolylineArc2)

Gets the distance from this triangle to a curved chain, using the default tolerance.

DistanceTo(GeoPolylineArc2, Tolerance)

Gets the distance from this triangle to a curved chain, within a tolerance.

DistanceTo(GeoRectangle2)

Gets the distance from this triangle to a rectangle.

DistanceTo(GeoTriangle2)

Gets the distance from this triangle to another triangle.

Equals(GeoTriangle2)

Determines whether another triangle has exactly the same vertices, in the same order.

Equals(object)

Determines whether the specified object is equal to the current triangle.

GetAngles()

Gets the angles at A, B and C, in radians.

GetClosestEdge(GeoCircle2)

Gets the edge of this triangle closest to a circle.

GetClosestEdge(GeoLine2)

Gets the edge of this triangle closest to a segment.

GetClosestEdge(GeoPoint2)

Gets the edge of this triangle closest to a point.

GetClosestPointOnBoundary(GeoPoint2)

Gets the point on the edges of this triangle closest to a point.

GetDistanceAtParameter(double)

Gets the length walked along the edges from A to a normalized parameter.

GetDistanceAtPoint(GeoPoint2)

Gets the length walked along the edges from A to the point on them closest to a point.

GetEdgeAt(int)

Gets the edge at a given index: 0 is A to B, 1 is B to C, 2 is C to A.

GetEdges()

Gets the three edges, A to B, B to C and C to A.

GetHashCode()

Returns the hash code for this instance.

GetIntersections(GeoArc2)

Gets every point where the edges of this triangle meet an arc, using the default tolerance.

GetIntersections(GeoArc2, Tolerance)

Gets every point where the edges of this triangle meet an arc, within a tolerance.

GetIntersections(GeoCircle2)

Gets every point where the edges of this triangle meet a circle, using the default tolerance.

GetIntersections(GeoCircle2, Tolerance)

Gets every point where the edges of this triangle meet a circle, within a tolerance.

GetIntersections(GeoEdge2)

Gets every point where the edges of this triangle meet an edge, using the default tolerance.

GetIntersections(GeoEdge2, Tolerance)

Gets every point where the edges of this triangle meet an edge, within a tolerance.

GetIntersections(GeoFace2)

Gets every point where the edges of this triangle meet a face, using the default tolerance.

GetIntersections(GeoFace2, Tolerance)

Gets every point where the edges of this triangle meet a face, within a tolerance.

GetIntersections(GeoLine2)

Gets every point where the edges of this triangle meet a segment, using the default tolerance.

GetIntersections(GeoLine2, Tolerance)

Gets every point where the edges of this triangle meet a segment, within a tolerance.

GetIntersections(GeoPolygon2)

Gets every point where the edges of this triangle meet a polygon, using the default tolerance.

GetIntersections(GeoPolygon2, Tolerance)

Gets every point where the edges of this triangle meet a polygon, within a tolerance.

GetIntersections(GeoPolygonArc2)

Gets every point where the edges of this triangle meet a curved loop, using the default tolerance.

GetIntersections(GeoPolygonArc2, Tolerance)

Gets every point where the edges of this triangle meet a curved loop, within a tolerance.

GetIntersections(GeoPolyline2)

Gets every point where the edges of this triangle meet a polyline, using the default tolerance.

GetIntersections(GeoPolyline2, Tolerance)

Gets every point where the edges of this triangle meet a polyline, within a tolerance.

GetIntersections(GeoPolylineArc2)

Gets every point where the edges of this triangle meet a curved chain, using the default tolerance.

GetIntersections(GeoPolylineArc2, Tolerance)

Gets every point where the edges of this triangle meet a curved chain, within a tolerance.

GetIntersections(GeoRectangle2)

Gets every point where the edges of this triangle meet a rectangle, using the default tolerance.

GetIntersections(GeoRectangle2, Tolerance)

Gets every point where the edges of this triangle meet a rectangle, within a tolerance.

GetIntersections(GeoTriangle2)

Gets every point where the edges of this triangle meet another triangle, using the default tolerance.

GetIntersections(GeoTriangle2, Tolerance)

Gets every point where the edges of this triangle meet another triangle, within a tolerance.

GetParameterAtDistance(double)

Gets the normalized parameter at a length walked along the edges from A.

GetParameterAtPoint(GeoPoint2)

Gets the normalized parameter along the edges of the point on them closest to a point.

GetPointAtBarycentric(double, double, double)

Gets the point at given barycentric coordinates.

GetPointAtDistance(double)

Gets the point at a length walked along the edges from A; lengths past the perimeter wrap round.

GetPointAtParameter(double)

Gets the point at a normalized parameter along the edges, from A, where 1 is all the way round; values outside [0, 1] wrap round, so 1.25 is the same place as 0.25.

GetShortestLineTo(GeoArc2)

Gets the shortest segment leaving this triangle and landing on an arc, using the default tolerance.

GetShortestLineTo(GeoArc2, Tolerance)

Gets the shortest segment leaving this triangle and landing on an arc, within a tolerance.

GetShortestLineTo(GeoCircle2)

Gets the shortest segment leaving this triangle and landing on a circle, using the default tolerance.

GetShortestLineTo(GeoCircle2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a circle, within a tolerance.

GetShortestLineTo(GeoEdge2)

Gets the shortest segment leaving this triangle and landing on an edge, using the default tolerance.

GetShortestLineTo(GeoEdge2, Tolerance)

Gets the shortest segment leaving this triangle and landing on an edge, within a tolerance.

GetShortestLineTo(GeoFace2)

Gets the shortest segment leaving this triangle and landing on a face, using the default tolerance.

GetShortestLineTo(GeoFace2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a face, within a tolerance.

GetShortestLineTo(GeoLine2)

Gets the shortest segment leaving this triangle and landing on a segment, using the default tolerance.

GetShortestLineTo(GeoLine2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a segment, within a tolerance.

GetShortestLineTo(GeoPolygon2)

Gets the shortest segment leaving this triangle and landing on a polygon, using the default tolerance.

GetShortestLineTo(GeoPolygon2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a polygon, within a tolerance.

GetShortestLineTo(GeoPolygonArc2)

Gets the shortest segment leaving this triangle and landing on a curved loop, using the default tolerance.

GetShortestLineTo(GeoPolygonArc2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a curved loop, within a tolerance.

GetShortestLineTo(GeoPolyline2)

Gets the shortest segment leaving this triangle and landing on a polyline, using the default tolerance.

GetShortestLineTo(GeoPolyline2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a polyline, within a tolerance.

GetShortestLineTo(GeoPolylineArc2)

Gets the shortest segment leaving this triangle and landing on a curved chain, using the default tolerance.

GetShortestLineTo(GeoPolylineArc2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a curved chain, within a tolerance.

GetShortestLineTo(GeoRectangle2)

Gets the shortest segment leaving this triangle and landing on a rectangle, using the default tolerance.

GetShortestLineTo(GeoRectangle2, Tolerance)

Gets the shortest segment leaving this triangle and landing on a rectangle, within a tolerance.

GetShortestLineTo(GeoTriangle2)

Gets the shortest segment leaving this triangle and landing on another triangle, using the default tolerance.

GetShortestLineTo(GeoTriangle2, Tolerance)

Gets the shortest segment leaving this triangle and landing on another triangle, within a tolerance.

GetVertices()

Gets the three vertices, in order.

IsDegenerate()

Checks whether the triangle has no area, using the default tolerance.

IsDegenerate(Tolerance)

Checks whether the triangle has no area, within a tolerance.

IsEqualTo(GeoTriangle2)

Compares whether this triangle equals another triangle using the default tolerance.

IsEqualTo(GeoTriangle2, Tolerance)

Compares whether this triangle equals another triangle within a tolerance.

IsParallelTo(GeoLine2)

Checks whether an edge of this triangle runs parallel to a segment, using the default tolerance.

IsParallelTo(GeoLine2, Tolerance)

Checks whether an edge of this triangle runs parallel to a segment, within a tolerance.

Locate(GeoPoint2)

Locates a point relative to this triangle, using the default tolerance.

Locate(GeoPoint2, Tolerance)

Locates a point relative to this triangle, within a tolerance: on its edges, inside it, or outside.

Reverse()

Gets the triangle running the other way round: A, C, B.

RotateBy(double, GeoPoint2)

Rotates the triangle around a point, counter-clockwise by an angle in radians.

SignedDistanceTo(GeoPoint2)

Gets the distance from this triangle to a point, negative for a point within it, using the default tolerance.

SignedDistanceTo(GeoPoint2, Tolerance)

Gets the distance from this triangle to a point, negative for a point within it, within a tolerance.

ToPolygon()

Reads the triangle as a three-sided polygon, running the way the triangle does.

ToPolyline()

Reads the boundary of the triangle as a closed chain, A to B to C and back to A.

ToString()

Returns a string that represents the current triangle.

ToTriangle3(GeoCoordinateSystem3)

Puts this triangle of the plane into space, on the plane of a frame.

TransformBy(GeoTransform2)

Applies a transformation to this triangle. A transformation that turns shapes round, a mirror or a negative scaling, reverses the winding.

Translate(GeoVector2)

Moves the triangle by a vector.

TryGetBarycentric(GeoPoint2, out double, out double, out double)

Gets the barycentric coordinates of a point with respect to this triangle.

TryGetCircumcircle(out GeoCircle2)

Gets the circle through all three vertices.

TryGetIncircle(out GeoCircle2)

Gets the largest circle inside the triangle, touching all three edges.

TryIntersectWith(GeoArc2, out GeoPoint2[])

Tries to find where the edges of this triangle meet an arc, using the default tolerance.

TryIntersectWith(GeoArc2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet an arc, within a tolerance.

TryIntersectWith(GeoCircle2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a circle, using the default tolerance.

TryIntersectWith(GeoCircle2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a circle, within a tolerance.

TryIntersectWith(GeoEdge2, out GeoPoint2[])

Tries to find where the edges of this triangle meet an edge, using the default tolerance.

TryIntersectWith(GeoEdge2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet an edge, within a tolerance.

TryIntersectWith(GeoFace2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a face, using the default tolerance.

TryIntersectWith(GeoFace2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a face, within a tolerance.

TryIntersectWith(GeoLine2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a segment, using the default tolerance.

TryIntersectWith(GeoLine2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a segment, within a tolerance.

TryIntersectWith(GeoPolygon2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a polygon, using the default tolerance.

TryIntersectWith(GeoPolygon2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a polygon, within a tolerance.

TryIntersectWith(GeoPolygonArc2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a curved loop, using the default tolerance.

TryIntersectWith(GeoPolygonArc2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a curved loop, within a tolerance.

TryIntersectWith(GeoPolyline2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a polyline, using the default tolerance.

TryIntersectWith(GeoPolyline2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a polyline, within a tolerance.

TryIntersectWith(GeoPolylineArc2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a curved chain, using the default tolerance.

TryIntersectWith(GeoPolylineArc2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a curved chain, within a tolerance.

TryIntersectWith(GeoRectangle2, out GeoPoint2[])

Tries to find where the edges of this triangle meet a rectangle, using the default tolerance.

TryIntersectWith(GeoRectangle2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet a rectangle, within a tolerance.

TryIntersectWith(GeoTriangle2, out GeoPoint2[])

Tries to find where the edges of this triangle meet another triangle, using the default tolerance.

TryIntersectWith(GeoTriangle2, out GeoPoint2[], Tolerance)

Tries to find where the edges of this triangle meet another triangle, within a tolerance.

Operators

operator +(GeoTriangle2, GeoVector2)

Translates a triangle by a vector.

operator ==(GeoTriangle2, GeoTriangle2)

Checks if two triangles have exactly the same vertices, in the same order.

operator !=(GeoTriangle2, GeoTriangle2)

Checks if two triangles differ in any vertex.

operator -(GeoTriangle2, GeoVector2)

Translates a triangle backwards by a vector.