# Synopsis

PDX_MSGT gdx_LocatePLinCurveCusps(long option, MDA_PTR gdx_db_ptr, double toler, double **cusps, long *numcusps)

# Purpose

Locate cusps and line segments a piecewise linear GDX curve.

# Description

This routine finds cusps (defined by an angular tolerance) which are located at the join of two linear segments of the piecewise linear curve. It also finds straight line segments within the curve (defined by at least 4 points being collinear).

# Input

## option

### GDX_UNNORM

Return normalized parameter values for the cusps that must be unnormalized for evaluation.

## gdx_db_ptr

The GDX curve database pointer.

## toler

Cosine angle tolerance. The angle between two neighboring linear segments can be between 0 degrees (no cusp) and 180 degrees. It is considered a cusp if the cosine of the angle between the segments is less than toler.

# Output

## cusps

is allocated in this routine (but only if at least one cusp or line segment is found). It must be deallocated in the calling program when it is no longer needed.

## numcusps

The number of parameter values in the array cusps. These correspond to cusps or straight line segments.

# Tolerances

COLLINEAR_TOL

# Return

          GDX_NOERR
          Low level error return
          .fi