Struct Quadrant
Quadrant values
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
public readonly struct Quadrant
Remarks
The quadants are numbered as follows:
1 - NW | 0 - NE
-------+-------
2 - SW | 3 - SE
Constructors
| Improve this Doc View SourceQuadrant(Coordinate, Coordinate)
Returns the quadrant of a directed line segment from p0 to p1.
Declaration
public Quadrant(Coordinate p0, Coordinate p1)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | p0 | |
Coordinate | p1 |
Exceptions
Type | Condition |
---|---|
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).
Declaration
public Quadrant(double dx, double dy)
Parameters
Type | Name | Description |
---|---|---|
Double | dx | |
Double | dy |
Exceptions
Type | Condition |
---|---|
ArgumentException | If the displacements are both 0 |
Quadrant(Int32)
Creates a quadrant with t
Declaration
public Quadrant(int value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value |
Properties
| Improve this Doc View SourceIsNorthern
Returns true
if the given quadrant is 0 or 1.
Declaration
public readonly bool IsNorthern { get; }
Property Value
Type | Description |
---|---|
Boolean |
NE
North-East
Declaration
public static readonly Quadrant NE { get; }
Property Value
Type | Description |
---|---|
Quadrant |
NW
North-West
Declaration
public static readonly Quadrant NW { get; }
Property Value
Type | Description |
---|---|
Quadrant |
SE
South-East
Declaration
public static readonly Quadrant SE { get; }
Property Value
Type | Description |
---|---|
Quadrant |
SW
South-West
Declaration
public static readonly Quadrant SW { get; }
Property Value
Type | Description |
---|---|
Quadrant |
Undefined
Undefined
Declaration
public static readonly Quadrant Undefined { get; }
Property Value
Type | Description |
---|---|
Quadrant |
Methods
| Improve this Doc View SourceCommonHalfPlane(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.
Declaration
public static Quadrant CommonHalfPlane(Quadrant quad1, Quadrant quad2)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | quad1 | |
Quadrant | quad2 |
Returns
Type | Description |
---|---|
Quadrant |
Equals(Object)
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceIsInHalfPlane(Quadrant)
Returns whether this quadrant lies within the given halfplane (specified by its right-hand quadrant).
Declaration
public readonly bool IsInHalfPlane(Quadrant halfPlane)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | halfPlane |
Returns
Type | Description |
---|---|
Boolean |
IsOpposite(Quadrant)
Returns true if the quadrants are 1 and 3, or 2 and 4.
Declaration
public readonly bool IsOpposite(Quadrant quad)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | quad | A quadrant |
Returns
Type | Description |
---|---|
Boolean |
ToString()
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Operators
| Improve this Doc View SourceEquality(Quadrant, Quadrant)
Equality operator for quadrants
Declaration
public static bool operator ==(Quadrant lhs, Quadrant rhs)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | lhs | Quadrant value on the left-hand-side |
Quadrant | rhs | Quadrant value on the right-hand-side |
Returns
Type | Description |
---|---|
Boolean |
|
GreaterThan(Quadrant, Quadrant)
Greater than (>) operator for quadrants
Declaration
public static bool operator>(Quadrant lhs, Quadrant rhs)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | lhs | Quadrant value on the left-hand-side |
Quadrant | rhs | Quadrant value on the right-hand-side |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(Quadrant, Quadrant)
Inequality operator for quadrants
Declaration
public static bool operator !=(Quadrant lhs, Quadrant rhs)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | lhs | Quadrant value on the left-hand-side |
Quadrant | rhs | Quadrant value on the right-hand-side |
Returns
Type | Description |
---|---|
Boolean |
|
LessThan(Quadrant, Quadrant)
Less than (<) operator for quadrants
Declaration
public static bool operator <(Quadrant lhs, Quadrant rhs)
Parameters
Type | Name | Description |
---|---|---|
Quadrant | lhs | Quadrant value on the left-hand-side |
Quadrant | rhs | Quadrant value on the right-hand-side |
Returns
Type | Description |
---|---|
Boolean |
|