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
p0
Coordinatep1
Coordinate
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
value
int
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
obj
object
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
halfPlane
Quadrant
Returns
IsOpposite(Quadrant)
Returns true if the quadrants are 1 and 3, or 2 and 4.
public bool IsOpposite(Quadrant quad)
Parameters
quad
QuadrantA 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
lhs
QuadrantQuadrant value on the left-hand-side
rhs
QuadrantQuadrant value on the right-hand-side
Returns
- bool
true
if quadrant value oflhs
andrhs
are equal.
operator >(Quadrant, Quadrant)
Greater than (>) operator for quadrants
public static bool operator >(Quadrant lhs, Quadrant rhs)
Parameters
lhs
QuadrantQuadrant value on the left-hand-side
rhs
QuadrantQuadrant value on the right-hand-side
Returns
- bool
true
if quadrant value oflhs
andrhs
are not equal.
operator !=(Quadrant, Quadrant)
Inequality operator for quadrants
public static bool operator !=(Quadrant lhs, Quadrant rhs)
Parameters
lhs
QuadrantQuadrant value on the left-hand-side
rhs
QuadrantQuadrant value on the right-hand-side
Returns
- bool
true
if quadrant value oflhs
andrhs
are not equal.
operator <(Quadrant, Quadrant)
Less than (<) operator for quadrants
public static bool operator <(Quadrant lhs, Quadrant rhs)
Parameters
lhs
QuadrantQuadrant value on the left-hand-side
rhs
QuadrantQuadrant value on the right-hand-side
Returns
- bool
true
if quadrant value oflhs
andrhs
are not equal.