Struct GeoRectangle2
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
Whether a rectangle touches another shape.
public readonly struct GeoRectangle2 : IEquatable<GeoRectangle2>
- Implements
- Inherited Members
- Extension Methods
Constructors
- GeoRectangle2(GeoCoordinateSystem2, double, double)
Initializes a rectangle from its own coordinate system and its size along each of its axes.
- GeoRectangle2(GeoPoint2, double, double, double)
Initializes a new GeoRectangle2 instance from center, width, height, and rotation angle.
- GeoRectangle2(double, double, double, double)
Initializes a new GeoRectangle2 instance from the bottom-left corner position (unrotated) and dimensions.
Properties
- AngleDeg
Gets the rotation angle in degrees (counter-clockwise).
- AngleRad
Gets the rotation angle in radians (counter-clockwise).
- Area
Gets the area the rectangle encloses. Turning it does not change it.
- Center
Gets the center point of the rectangle.
- CoordinateSystem
Gets the local coordinate system of the rectangle: its centre and its two orthonormal axes.
- Height
Gets the height of the rectangle (along its local Y-axis).
- IsRotated
Gets a value indicating whether the rectangle is rotated, that is whether its rotation angle differs from zero by more than the angular tolerance once full turns are removed.
- IsValid
Gets whether this is a shape a constructor could have made: the centre is a valid point, the sizes numbers of nought or more and the angle a number.
- LeftMiddle
Gets the middle point of the left edge (between UpperLeft and LowerLeft).
- Length
Gets the perimeter (total boundary length) of the rectangle.
- LowerLeft
Gets the bottom-left corner coordinates.
- LowerMiddle
Gets the middle point of the bottom edge (between LowerLeft and LowerRight).
- LowerRight
Gets the bottom-right corner coordinates.
- RightMiddle
Gets the middle point of the right edge (between LowerRight and UpperRight).
- UpperLeft
Gets the top-left corner coordinates.
- UpperMiddle
Gets the middle point of the top edge (between UpperRight and UpperLeft).
- UpperRight
Gets the top-right corner coordinates.
- Width
Gets the width of the rectangle (along its local X-axis).
Methods
- Clone()
Creates a copy of this rectangle.
- CollidesWith(GeoArc2)
Determines whether this rectangle touches or overlaps an arc.
- CollidesWith(GeoArc2, Tolerance)
Determines whether this rectangle touches or overlaps an arc, within a tolerance.
- CollidesWith(GeoCircle2)
Checks whether this rectangle collides with a circle using default tolerance.
- CollidesWith(GeoCircle2, Tolerance)
Checks whether this rectangle collides with a circle within tolerance.
- CollidesWith(GeoEdge2)
Checks whether this rectangle touches an edge.
- CollidesWith(GeoEdge2, Tolerance)
Checks whether this rectangle touches an edge, within a tolerance.
- CollidesWith(GeoFace2)
Checks whether this rectangle reaches the material of a face, using the default tolerance.
- CollidesWith(GeoFace2, Tolerance)
Checks whether this rectangle reaches the material of a face, within a tolerance.
- CollidesWith(GeoLine2)
Checks whether this rectangle collides with a line segment using default tolerance.
- CollidesWith(GeoLine2, Tolerance)
Checks whether this rectangle collides with a line segment within tolerance.
- CollidesWith(GeoPolygon2)
Checks whether this rectangle collides with a polygon using default tolerance.
- CollidesWith(GeoPolygon2, Tolerance)
Checks whether this rectangle collides with a polygon within tolerance.
- CollidesWith(GeoPolygonArc2)
Determines whether this rectangle touches or overlaps a curved loop.
- CollidesWith(GeoPolygonArc2, Tolerance)
Determines whether this rectangle touches or overlaps a curved loop, within a tolerance.
- CollidesWith(GeoPolyline2)
Checks whether this rectangle collides with a polyline using default tolerance.
- CollidesWith(GeoPolyline2, Tolerance)
Checks whether this rectangle collides with a polyline within tolerance.
- CollidesWith(GeoPolylineArc2)
Determines whether this rectangle touches or overlaps a curved chain.
- CollidesWith(GeoPolylineArc2, Tolerance)
Determines whether this rectangle touches or overlaps a curved chain, within a tolerance.
- CollidesWith(GeoRectangle2)
Checks whether this rectangle collides with another rectangle using default tolerance.
- CollidesWith(GeoRectangle2, Tolerance)
Checks whether this rectangle collides with another rectangle within tolerance.
- CollidesWith(GeoTriangle2)
Checks whether this rectangle touches a triangle, using the default tolerance.
- CollidesWith(GeoTriangle2, Tolerance)
Checks whether this rectangle touches a triangle, within a tolerance.
- Combine(GeoPoint2)
Combines this rectangle with a point, returning a new rectangle that encloses both. The resulting rectangle maintains the same orientation (angle) as this rectangle.
- Combine(params GeoPoint2[])
Combines this rectangle with an array of points, returning a new rectangle that encloses this rectangle and all points. The resulting rectangle maintains the same orientation (angle) as this rectangle.
- Combine(GeoRectangle2)
Combines this rectangle with another rectangle, returning a new rectangle that encloses both. The resulting rectangle maintains the same orientation (angle) as this rectangle.
- Combine(IEnumerable<GeoPoint2>)
Combines this rectangle with a collection of points, returning a new rectangle that encloses this rectangle and all points. The resulting rectangle maintains the same orientation (angle) as this rectangle.
- Contains(GeoLine2)
Checks whether the rectangle entirely contains a line segment using default tolerance.
- Contains(GeoLine2, Tolerance)
Checks whether the rectangle entirely contains a line segment within tolerance.
- Contains(GeoPoint2)
Checks whether the rectangle contains a point.
- Contains(GeoPolyline2)
Checks whether the rectangle entirely contains a polyline using default tolerance.
- Contains(GeoPolyline2, Tolerance)
Checks whether the rectangle entirely contains a polyline within tolerance.
- DistanceTo(GeoArc2)
Calculates the shortest distance from this rectangle to an arc.
- DistanceTo(GeoArc2, Tolerance)
Calculates the shortest distance from this rectangle to an arc, within a tolerance.
- DistanceTo(GeoCircle2)
Calculates the shortest boundary distance from this rectangle to a circle.
- DistanceTo(GeoEdge2)
Gets the distance from this rectangle to an edge.
- DistanceTo(GeoLine2)
Calculates the shortest boundary distance from this rectangle to a line segment.
- DistanceTo(GeoPoint2)
Calculates the shortest Euclidean distance from this rectangle to a point.
- DistanceTo(GeoPolygon2)
Calculates the shortest boundary distance from this rectangle to a polygon.
- DistanceTo(GeoPolygonArc2)
Calculates the shortest distance from this rectangle to a curved loop.
- DistanceTo(GeoPolygonArc2, Tolerance)
Calculates the shortest distance from this rectangle to a curved loop, within a tolerance.
- DistanceTo(GeoPolyline2)
Calculates the shortest distance from this rectangle to a polyline.
- DistanceTo(GeoPolylineArc2)
Calculates the shortest distance from this rectangle to a curved chain.
- DistanceTo(GeoPolylineArc2, Tolerance)
Calculates the shortest distance from this rectangle to a curved chain, within a tolerance.
- DistanceTo(GeoRectangle2)
Calculates the shortest boundary distance from this rectangle to another rectangle.
- DistanceTo(GeoTriangle2)
Gets the distance from this rectangle to a triangle.
- Divide(int, int)
Divides the rectangle into equal rectangles along its own sides.
- Equals(GeoRectangle2)
Indicates whether the current rectangle is equal to another rectangle.
- Equals(object)
Indicates whether this instance and a specified object are equal.
- Fit(IEnumerable<GeoPoint2>)
Gets the rectangle of least area round some points, using the default tolerance.
- Fit(IEnumerable<GeoPoint2>, Tolerance)
Gets the rectangle of least area round some points, turned whichever way makes it smallest.
- GetClosestEdge(GeoCircle2)
Gets the edge of this rectangle nearest a circle.
- GetClosestEdge(GeoLine2)
Gets the edge of this rectangle nearest a segment.
- GetClosestEdge(GeoPoint2)
Gets the edge of this rectangle nearest a point.
- GetClosestPointOnBoundary(GeoPoint2)
Gets the closest point on the boundary of this rectangle to a target point, including for points inside the rectangle.
- GetDistanceAtParameter(double)
Gets the arc length from the LowerLeft corner of this rectangle perimeter to a normalized parameter.
- GetDistanceAtPoint(GeoPoint2)
Gets the arc length from the LowerLeft corner of this rectangle perimeter to the point on it closest to the supplied point.
- GetEdges()
Gets the 4 closed edges of the rectangle, sequentially connecting the vertices returned by GetVertices().
- GetHashCode()
Returns the hash code for this instance.
- GetIntersections(GeoArc2)
Gets the points where this rectangle meets an arc.
- GetIntersections(GeoArc2, Tolerance)
Gets the points where this rectangle meets an arc, within a tolerance.
- GetIntersections(GeoCircle2)
Gets all intersection points with a circle using default tolerance.
- GetIntersections(GeoCircle2, Tolerance)
Gets all intersection points with a circle within tolerance.
- GetIntersections(GeoEdge2)
Gets every point where this rectangle crosses an edge.
- GetIntersections(GeoEdge2, Tolerance)
Gets every point where this rectangle crosses an edge, within a tolerance.
- GetIntersections(GeoFace2)
Gets every point where this rectangle crosses the boundary of a face, using the default tolerance.
- GetIntersections(GeoFace2, Tolerance)
Gets every point where this rectangle crosses the boundary of a face, within a tolerance.
- GetIntersections(GeoLine2)
Gets all intersection points with a line segment using default tolerance.
- GetIntersections(GeoLine2, Tolerance)
Gets all intersection points with a line segment within tolerance.
- GetIntersections(GeoPolygon2)
Gets all intersection points with a polygon using default tolerance.
- GetIntersections(GeoPolygon2, Tolerance)
Gets all intersection points with a polygon within tolerance.
- GetIntersections(GeoPolygonArc2)
Gets the points where this rectangle meets a curved loop.
- GetIntersections(GeoPolygonArc2, Tolerance)
Gets the points where this rectangle meets a curved loop, within a tolerance.
- GetIntersections(GeoPolyline2)
Gets all intersection points with a polyline using default tolerance.
- GetIntersections(GeoPolyline2, Tolerance)
Gets all intersection points with a polyline within tolerance.
- GetIntersections(GeoPolylineArc2)
Gets the points where this rectangle meets a curved chain.
- GetIntersections(GeoPolylineArc2, Tolerance)
Gets the points where this rectangle meets a curved chain, within a tolerance.
- GetIntersections(GeoRectangle2)
Gets all intersection points with another rectangle using default tolerance.
- GetIntersections(GeoRectangle2, Tolerance)
Gets all intersection points with another rectangle within tolerance.
- GetIntersections(GeoTriangle2)
Gets every point where this rectangle meets the edges of a triangle, using the default tolerance.
- GetIntersections(GeoTriangle2, Tolerance)
Gets every point where this rectangle meets the edges of a triangle, within a tolerance.
- GetParameterAtDistance(double)
Gets the normalized parameter at an arc length measured from the LowerLeft corner of this rectangle perimeter.
- GetParameterAtPoint(GeoPoint2)
Gets the normalized parameter of the point on this rectangle perimeter closest to the supplied point.
- GetPointAtDistance(double)
Gets the point at an arc length measured from the LowerLeft corner of this rectangle perimeter.
- GetPointAtParameter(double)
Gets the point at a normalized parameter along this rectangle perimeter, where 0 is the LowerLeft corner and 1 is the end. Values outside [0, 1] wrap around, so 1.25 is the same position as 0.25.
- GetShortestLineTo(GeoArc2)
Gets the shortest segment joining this rectangle to an arc.
- GetShortestLineTo(GeoArc2, Tolerance)
Gets the shortest segment joining this rectangle to an arc, within a tolerance.
- GetShortestLineTo(GeoCircle2)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on the circumference of a circle using default tolerance.
- GetShortestLineTo(GeoCircle2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on the circumference of a circle within tolerance.
- GetShortestLineTo(GeoEdge2)
Gets the shortest segment leaving this rectangle and landing on an edge.
- GetShortestLineTo(GeoEdge2, Tolerance)
Gets the shortest segment leaving this rectangle and landing on an edge, within a tolerance.
- GetShortestLineTo(GeoFace2)
Gets the shortest segment leaving this rectangle and landing on the boundary of a face, using the default tolerance.
- GetShortestLineTo(GeoFace2, Tolerance)
Gets the shortest segment leaving this rectangle and landing on the boundary of a face, within a tolerance.
- GetShortestLineTo(GeoLine2)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on a line segment using default tolerance.
- GetShortestLineTo(GeoLine2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on a line segment within tolerance.
- GetShortestLineTo(GeoPolygon2)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on the boundary of a polygon using default tolerance.
- GetShortestLineTo(GeoPolygon2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on the boundary of a polygon within tolerance.
- GetShortestLineTo(GeoPolygonArc2)
Gets the shortest segment joining this rectangle to a curved loop.
- GetShortestLineTo(GeoPolygonArc2, Tolerance)
Gets the shortest segment joining this rectangle to a curved loop, within a tolerance.
- GetShortestLineTo(GeoPolyline2)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on a polyline using default tolerance.
- GetShortestLineTo(GeoPolyline2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on a polyline within tolerance.
- GetShortestLineTo(GeoPolylineArc2)
Gets the shortest segment joining this rectangle to a curved chain.
- GetShortestLineTo(GeoPolylineArc2, Tolerance)
Gets the shortest segment joining this rectangle to a curved chain, within a tolerance.
- GetShortestLineTo(GeoRectangle2)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on the boundary of another rectangle using default tolerance.
- GetShortestLineTo(GeoRectangle2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this rectangle to a point on the boundary of another rectangle within tolerance.
- GetShortestLineTo(GeoTriangle2)
Gets the shortest segment leaving this rectangle and landing on a triangle, using the default tolerance.
- GetShortestLineTo(GeoTriangle2, Tolerance)
Gets the shortest segment leaving this rectangle and landing on a triangle, within a tolerance.
- GetVertices()
Gets the 4 vertices of the rectangle in counter-clockwise order: LowerLeft, LowerRight, UpperRight, UpperLeft.
- IsEqualTo(GeoRectangle2)
Determines whether another rectangle covers the same region, within the default tolerance.
- IsEqualTo(GeoRectangle2, Tolerance)
Determines whether another rectangle covers the same region, within a tolerance.
- IsParallelTo(GeoLine2)
Checks whether a line segment is parallel to this rectangle's axes using default tolerance.
- IsParallelTo(GeoLine2, Tolerance)
Checks whether a line segment is parallel to this rectangle's axes within angular tolerance.
- IsParallelTo(GeoRectangle2)
Checks whether another rectangle is parallel in orientation to this rectangle using default tolerance.
- IsParallelTo(GeoRectangle2, Tolerance)
Checks whether another rectangle is parallel in orientation to this rectangle within angular tolerance.
- Locate(GeoPoint2)
Classifies the location of a point relative to this rectangle (Inside, OutSide, or OnSide) using default tolerance.
- Locate(GeoPoint2, Tolerance)
Classifies the location of a point relative to this rectangle (Inside, OutSide, or OnSide) within tolerance.
- RotateBy(double, GeoPoint2)
Rotates the rectangle around a center point by an angle in radians (counter-clockwise).
- SignedDistanceTo(GeoPoint2)
Calculates the distance from this rectangle to a point, negative for a point within it.
- SignedDistanceTo(GeoPoint2, Tolerance)
Calculates the distance from this rectangle to a point, negative for a point within it, within a tolerance.
- ToMesh(MeshKind)
Breaks the rectangle into faces of a kind, using the default tolerance. A grid needs the size of its cells, which ToMesh(MeshOptions) takes.
- ToMesh(MeshOptions)
Breaks the rectangle into faces as the options say, using the default tolerance.
- ToMesh(MeshOptions, Tolerance)
Breaks the rectangle into faces as the options say, within a tolerance: triangles, the cells of a grid, strips or convex pieces, each a simple polygon with no hole, counter-clockwise, meeting its neighbours edge to edge.
- ToPolygon()
Converts this rectangle into a solid 2D GeoPolygon2.
- ToPolyline()
Converts this rectangle's boundary into a closed 2D GeoPolyline2. The boundary is closed by repeating the first vertex at the end of the chain.
- ToString()
Returns the string representation of the rectangle.
- TransformBy(GeoTransform2)
Applies a transformation to this rectangle.
- Translate(GeoVector2)
Translates the rectangle by a displacement vector.
- TriangulateSurface()
Breaks the rectangle into two triangles, along the diagonal from its lower left corner, using the default tolerance.
- TriangulateSurface(Tolerance)
Breaks the rectangle into two triangles, along the diagonal from its lower left corner, within a tolerance.
- TryIntersectWith(GeoArc2, out GeoPoint2[])
Tries to find where this rectangle meets an arc.
- TryIntersectWith(GeoArc2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets an arc, within a tolerance.
- TryIntersectWith(GeoCircle2, out GeoPoint2[])
Tries to find where this rectangle meets a circle.
- TryIntersectWith(GeoCircle2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a circle, within a tolerance.
- TryIntersectWith(GeoEdge2, out GeoPoint2[])
Tries to find where this rectangle meets an edge.
- TryIntersectWith(GeoEdge2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets an edge, within a tolerance.
- TryIntersectWith(GeoFace2, out GeoPoint2[])
Tries to find where this rectangle meets a face.
- TryIntersectWith(GeoFace2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a face, within a tolerance.
- TryIntersectWith(GeoLine2, out GeoPoint2[])
Tries to find where this rectangle meets a segment.
- TryIntersectWith(GeoLine2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a segment, within a tolerance.
- TryIntersectWith(GeoPolygon2, out GeoPoint2[])
Tries to find where this rectangle meets a polygon.
- TryIntersectWith(GeoPolygon2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a polygon, within a tolerance.
- TryIntersectWith(GeoPolygonArc2, out GeoPoint2[])
Tries to find where this rectangle meets a loop that may curve.
- TryIntersectWith(GeoPolygonArc2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a loop that may curve, within a tolerance.
- TryIntersectWith(GeoPolyline2, out GeoPoint2[])
Tries to find where this rectangle meets a chain.
- TryIntersectWith(GeoPolyline2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a chain, within a tolerance.
- TryIntersectWith(GeoPolylineArc2, out GeoPoint2[])
Tries to find where this rectangle meets a chain that may curve.
- TryIntersectWith(GeoPolylineArc2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a chain that may curve, within a tolerance.
- TryIntersectWith(GeoRectangle2, out GeoPoint2[])
Tries to find where this rectangle meets a rectangle.
- TryIntersectWith(GeoRectangle2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets a rectangle, within a tolerance.
- TryIntersectWith(GeoTriangle2, out GeoPoint2[])
Tries to find where this rectangle meets the edges of a triangle, using the default tolerance.
- TryIntersectWith(GeoTriangle2, out GeoPoint2[], Tolerance)
Tries to find where this rectangle meets the edges of a triangle, within a tolerance.
- TryOffset(double, out GeoRectangle2)
Grows this rectangle by a distance on every side, or shrinks it when the distance is negative, keeping its corners square, using default tolerance.
- TryOffset(double, out GeoRectangle2, Tolerance)
Grows this rectangle by a distance on every side, or shrinks it when the distance is negative, keeping its corners square, within tolerance.
Operators
- operator +(GeoRectangle2, GeoVector2)
Translates a rectangle by a vector.
- operator ==(GeoRectangle2, GeoRectangle2)
Compares two GeoRectangle2 instances for equality.
- operator !=(GeoRectangle2, GeoRectangle2)
Compares two GeoRectangle2 instances for inequality.
- operator -(GeoRectangle2, GeoVector2)
Translates a rectangle backwards by a vector.