Struct Quadrant
- Namespace
- NetTopologySuite.Geometries
- Assembly
- NetTopologySuite.dll
Quadrant values
public readonly struct Quadrant
- Inherited Members
Remarks
The quadants are numbered as follows:
1 - NW | 0 - NE
-------+-------
2 - SW | 3 - SE
Constructors
Quadrant(Coordinate, Coordinate)
Returns the quadrant of a directed line segment from p0 to p1.
public Quadrant(Coordinate p0, Coordinate p1)
Parameters
p0Coordinatep1Coordinate
Exceptions
- ArgumentException
if the points are equal
Quadrant(double, double)
Creates a quadrant of a directed line segment (specified as x and y displacements, which cannot both be 0).
public Quadrant(double dx, double dy)
Parameters
Exceptions
- ArgumentException
If the displacements are both 0
Quadrant(int)
Creates a quadrant with t
public Quadrant(int value)
Parameters
valueint
Properties
IsNorthern
Returns true if the given quadrant is 0 or 1.
public bool IsNorthern { get; }
Property Value
NE
North-East
public static Quadrant NE { get; }
Property Value
NW
North-West
public static Quadrant NW { get; }
Property Value
SE
South-East
public static Quadrant SE { get; }
Property Value
SW
South-West
public static Quadrant SW { get; }
Property Value
Undefined
Undefined
public static Quadrant Undefined { get; }
Property Value
Methods
CommonHalfPlane(Quadrant, Quadrant)
Returns the right-hand quadrant of the halfplane defined by the two quadrants, or -1 if the quadrants are opposite, or the quadrant if they are identical.
public static Quadrant CommonHalfPlane(Quadrant quad1, Quadrant quad2)
Parameters
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
IsInHalfPlane(Quadrant)
Returns whether this quadrant lies within the given halfplane (specified by its right-hand quadrant).
public bool IsInHalfPlane(Quadrant halfPlane)
Parameters
halfPlaneQuadrant
Returns
IsOpposite(Quadrant)
Returns true if the quadrants are 1 and 3, or 2 and 4.
public bool IsOpposite(Quadrant quad)
Parameters
quadQuadrantA quadrant
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(Quadrant, Quadrant)
Equality operator for quadrants
public static bool operator ==(Quadrant lhs, Quadrant rhs)
Parameters
lhsQuadrantQuadrant value on the left-hand-side
rhsQuadrantQuadrant value on the right-hand-side
Returns
- bool
trueif quadrant value oflhsandrhsare equal.
operator >(Quadrant, Quadrant)
Greater than (>) operator for quadrants
public static bool operator >(Quadrant lhs, Quadrant rhs)
Parameters
lhsQuadrantQuadrant value on the left-hand-side
rhsQuadrantQuadrant value on the right-hand-side
Returns
- bool
trueif quadrant value oflhsandrhsare not equal.
operator !=(Quadrant, Quadrant)
Inequality operator for quadrants
public static bool operator !=(Quadrant lhs, Quadrant rhs)
Parameters
lhsQuadrantQuadrant value on the left-hand-side
rhsQuadrantQuadrant value on the right-hand-side
Returns
- bool
trueif quadrant value oflhsandrhsare not equal.
operator <(Quadrant, Quadrant)
Less than (<) operator for quadrants
public static bool operator <(Quadrant lhs, Quadrant rhs)
Parameters
lhsQuadrantQuadrant value on the left-hand-side
rhsQuadrantQuadrant value on the right-hand-side
Returns
- bool
trueif quadrant value oflhsandrhsare not equal.