Struct Envelope2D
- Namespace
- SpatialNET
- Assembly
- SpatialNET.Core.dll
The envelope: the axis-aligned rectangle that encloses a geometry. A value, not an interface; hosts do not have to implement anything (ADR 0002).
public readonly record struct Envelope2D : IEquatable<Envelope2D>Implements
Inherited Members
Extension Methods
Constructors
Envelope2D(double, double, double, double)
The envelope: the axis-aligned rectangle that encloses a geometry. A value, not an interface; hosts do not have to implement anything (ADR 0002).
public Envelope2D(double MinX, double MinY, double MaxX, double MaxY)Parameters
MinXdouble-
Smallest X coordinate.
MinYdouble-
Smallest Y coordinate.
MaxXdouble-
Largest X coordinate.
MaxYdouble-
Largest Y coordinate.
Properties
Center
The center; both values are System.Double.NaN if SpatialNET.Envelope2D.IsEmpty.
public Coordinate Center { get; }Property Value
Empty
The envelope of an empty geometry; all values are System.Double.NaN.
public static Envelope2D Empty { get; }Property Value
Height
The extent in Y direction; System.Double.NaN if SpatialNET.Envelope2D.IsEmpty.
public double Height { get; }Property Value
IsEmpty
Whether this is the envelope of an empty geometry.
public bool IsEmpty { get; }Property Value
MaxX
Largest X coordinate.
public double MaxX { get; init; }Property Value
MaxY
Largest Y coordinate.
public double MaxY { get; init; }Property Value
MinX
Smallest X coordinate.
public double MinX { get; init; }Property Value
MinY
Smallest Y coordinate.
public double MinY { get; init; }Property Value
Width
The extent in X direction; System.Double.NaN if SpatialNET.Envelope2D.IsEmpty.
public double Width { get; }Property Value
Methods
Contains(Envelope2D)
Whether other lies completely in this envelope (the border counts). An empty envelope contains nothing and lies in nothing.
public bool Contains(Envelope2D other)Parameters
otherEnvelope2D-
The other envelope.
Returns
Contains(Coordinate)
Whether the point lies in this envelope (the border counts); a point with a System.Double.NaN value does not.
public bool Contains(Coordinate point)Parameters
pointCoordinate-
The point.
Returns
Expand(double)
The envelope widened on all sides by distance; a negative distance shrinks it and gives
SpatialNET.Envelope2D.Empty if nothing is left. An empty envelope, or a System.Double.NaN distance, gives SpatialNET.Envelope2D.Empty.
public Envelope2D Expand(double distance)Parameters
distancedouble-
The distance; negative to shrink.
Returns
Intersection(Envelope2D)
The common part of both envelopes; SpatialNET.Envelope2D.Empty if they do not meet.
public Envelope2D Intersection(Envelope2D other)Parameters
otherEnvelope2D-
The other envelope.
Returns
Intersects(Envelope2D)
Whether the two envelopes touch or overlap (closed intervals). An empty envelope meets nothing.
public bool Intersects(Envelope2D other)Parameters
otherEnvelope2D-
The other envelope.
Returns
Union(Envelope2D)
The smallest envelope that contains both; the other one if this or other is empty.
public Envelope2D Union(Envelope2D other)Parameters
otherEnvelope2D-
The other envelope.