geos::geom::Quadrant Class Reference

Utility functions for working with quadrants. More...

`#include <Quadrant.h>`

## Static Public Member Functions

static int | quadrant (double dx, double dy)
static int | quadrant (const geom::CoordinateXY &p0, const geom::CoordinateXY &p1)
static double | pseudoAngle (const CoordinateXY &p0, const CoordinateXY &p1)
static bool | isOpposite (int quad1, int quad2)
static int | commonHalfPlane (int quad1, int quad2)
static bool | isInHalfPlane (int quad, int halfPlane)
static bool | isNorthern (int quad)

## Static Public Attributes

static const int | NE = 0
static const int | NW = 1
static const int | SW = 2
static const int | SE = 3

## Detailed Description

Utility functions for working with quadrants.

The quadrants are numbered as follows:

    1 | 0
    --+--
    2 | 3

## Member Function Documentation

## isInHalfPlane()

bool geos::geom::Quadrant::isInHalfPlane | ( | int | quad,
|  | int | halfPlane )

static

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

## isNorthern()

bool geos::geom::Quadrant::isNorthern | ( | int | quad | ) |

inline static

Returns true if the given quadrant is 0 or 1.

## isOpposite()

bool geos::geom::Quadrant::isOpposite | ( | int | quad1,
|  | int | quad2 )

inline static

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

## pseudoAngle()

double geos::geom::Quadrant::pseudoAngle | ( | const CoordinateXY & | p0,
|  | const CoordinateXY & | p1 )

inline static

Return a measure that increases monotonically with counterclockwise angle and avoids trigonometric calculations. Values are consistent with the numeric quadrant codes

Parameters

  p0 | circle center coordinate
  p1 | coordinate for which pseudoangle should be calculated

## quadrant() [1/2]

int geos::geom::Quadrant::quadrant | ( | const geom::CoordinateXY & | p0,
|  | const geom::CoordinateXY & | p1 )

inline static

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

Exceptions

  IllegalArgumentException | if the points are equal

## quadrant() [2/2]

int geos::geom::Quadrant::quadrant | ( | double | dx,
|  | double | dy )

inline static

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

Exceptions

  IllegalArgumentException | if the displacements are both 0

Referenced by geos::geom::CircularArc::isUpwardAtPoint().

The documentation for this class was generated from the following file:

- Quadrant.h