Table of Contents

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 Coordinate
p1 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

dx double
dy double

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

bool

NE

North-East

public static Quadrant NE { get; }

Property Value

Quadrant

NW

North-West

public static Quadrant NW { get; }

Property Value

Quadrant

SE

South-East

public static Quadrant SE { get; }

Property Value

Quadrant

SW

South-West

public static Quadrant SW { get; }

Property Value

Quadrant

Undefined

Undefined

public static Quadrant Undefined { get; }

Property Value

Quadrant

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

quad1 Quadrant
quad2 Quadrant

Returns

Quadrant

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

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

bool

IsOpposite(Quadrant)

Returns true if the quadrants are 1 and 3, or 2 and 4.

public bool IsOpposite(Quadrant quad)

Parameters

quad Quadrant

A quadrant

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(Quadrant, Quadrant)

Equality operator for quadrants

public static bool operator ==(Quadrant lhs, Quadrant rhs)

Parameters

lhs Quadrant

Quadrant value on the left-hand-side

rhs Quadrant

Quadrant value on the right-hand-side

Returns

bool

true if quadrant value of lhs and rhs are equal.

operator >(Quadrant, Quadrant)

Greater than (>) operator for quadrants

public static bool operator >(Quadrant lhs, Quadrant rhs)

Parameters

lhs Quadrant

Quadrant value on the left-hand-side

rhs Quadrant

Quadrant value on the right-hand-side

Returns

bool

true if quadrant value of lhs and rhs are not equal.

operator !=(Quadrant, Quadrant)

Inequality operator for quadrants

public static bool operator !=(Quadrant lhs, Quadrant rhs)

Parameters

lhs Quadrant

Quadrant value on the left-hand-side

rhs Quadrant

Quadrant value on the right-hand-side

Returns

bool

true if quadrant value of lhs and rhs are not equal.

operator <(Quadrant, Quadrant)

Less than (<) operator for quadrants

public static bool operator <(Quadrant lhs, Quadrant rhs)

Parameters

lhs Quadrant

Quadrant value on the left-hand-side

rhs Quadrant

Quadrant value on the right-hand-side

Returns

bool

true if quadrant value of lhs and rhs are not equal.