Table of Contents

Class QuadrantOp

Namespace
NetTopologySuite.GeometriesGraph
Assembly
NetTopologySuite.dll

Utility functions for working with quadrants, which are numbered as follows:

1 | 0 --+-- 2 | 3

[Obsolete("Use NetTopologySuite.Geometries.Quadrant")]
public class QuadrantOp
Inheritance
QuadrantOp
Inherited Members

Fields

NE

North-East

public static readonly int NE

Field Value

int

NW

North-West

public static readonly int NW

Field Value

int

SE

South-East

public static readonly int SE

Field Value

int

SW

South-West

public static readonly int SW

Field Value

int

Methods

CommonHalfPlane(int, int)

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 int CommonHalfPlane(int quad1, int quad2)

Parameters

quad1 int
quad2 int

Returns

int

IsInHalfPlane(int, int)

Returns whether the given quadrant lies within the given halfplane (specified by its right-hand quadrant).

public static bool IsInHalfPlane(int quad, int halfPlane)

Parameters

quad int
halfPlane int

Returns

bool

IsNorthern(int)

Returns true if the given quadrant is 0 or 1.

public static bool IsNorthern(int quad)

Parameters

quad int

Returns

bool

IsOpposite(int, int)

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

public static bool IsOpposite(int quad1, int quad2)

Parameters

quad1 int
quad2 int

Returns

bool

Quadrant(Coordinate, Coordinate)

Returns the quadrant of a directed line segment from p0 to p1.

public static int Quadrant(Coordinate p0, Coordinate p1)

Parameters

p0 Coordinate
p1 Coordinate

Returns

int

Exceptions

ArgumentException

if the points are equal

Quadrant(double, double)

Returns the quadrant of a directed line segment (specified as x and y displacements, which cannot both be 0).

public static int Quadrant(double dx, double dy)

Parameters

dx double
dy double

Returns

int

Exceptions

ArgumentException

If the displacements are both 0