| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csChainHull2D Class Reference
[Geometry utilities]

This is Andrew's monotone chain 2D convex hull algorithm. More...

`#include <csgeom/chainhull2d.h>`

List of all members.

## Static Public Member Functions
static size_t | CalculatePresorted (csVector2 *points, size_t n, csVector2 *hull)
| This routine will calculate the convex hull of the presorted input points (presorted by increasing x and y coordinates).
static void | SortXY (csVector2 *points, size_t n)
| Sort the given array by increasing x and y coordinates so that it can be used by CalculatePresorted().

## Detailed Description

This is Andrew's monotone chain 2D convex hull algorithm.

Definition at line 46 of file chainhull2d.h.

## Member Function Documentation

static size_t csChainHull2D::CalculatePresorted | ( | csVector2 * | points,
|  | size_t | n,
|  | csVector2 * | hull |
| ) |  |  | `[static]`

This routine will calculate the convex hull of the presorted input points (presorted by increasing x and y coordinates).

Parameters:

  | points | is the presorted set of points.
  | n | is the number of points
  | hull | is the convex hull output. This array must be at least as big as the 'points' array (i.e. n points)

Returns:
  the number of points in the convex hull

static void csChainHull2D::SortXY | ( | csVector2 * | points,
|  | size_t | n |
| ) |  |  | `[static]`

Sort the given array by increasing x and y coordinates so that it can be used by CalculatePresorted().

Parameters:

  | points | is the set of points
  | n | is the number of points

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

- csgeom/chainhull2d.h