TerraLib 4.1
Functions used to deal with smooth curves

## Functions

TL_DLL bool TeGetCenter (TePoint p1, TePoint p2, TePoint p3, TePoint &center)
Given three points of a circunference, returns its center point.
TL_DLL double TeGetRadius (TePoint &p1, TePoint &p2, TePoint &p3)
Given three points of a circunference, returns the radius.
TL_DLL bool TeGenerateArc (TePoint &p1, TePoint &p2, TePoint &p3, TeLine2D &arcOut, const short &NPoints)
Given three points returns a smooth arc as a TeLine2D that contains a given total number of points.
TL_DLL bool TeGenerateCircle (const TePoint &center, const double &radius, TeLine2D &circle, const short &NPoints)
Given a center point and a radius, returns the circle as a TeLine2D interpolated by a given number of points.
TL_DLL bool TeLineSimplify (TeLine2D &line, double snap, double maxdist)
Performs a line simplication.
TL_DLL bool TeAdjustSegment (TeCoord2D P0, TeCoord2D P1, double d0, TeCoord2D &P0out, TeCoord2D &P1out)
TL_DLL bool TeFindCentroid (const TeLine2D &line, TeCoord2D &p)
Get middle line Method like find Centroid but this method calculate the correct middle point.

## Function Documentation

 TL_DLL bool TeAdjustSegment ( TeCoord2D P0, TeCoord2D P1, double d0, TeCoord2D & P0out, TeCoord2D & P1out )

Parameters:
 P0 first coordinate P1 second coordinate d0 distance value to adjust P0out first coordinate adjusted P1out second coordinate adjusted
Returns:
returns true whether possible adjust segment
 TL_DLL bool TeFindCentroid ( const TeLine2D & line, TeCoord2D & p )

Get middle line Method like find Centroid but this method calculate the correct middle point.

Parameters:
 line The Line to calculate the middle point p middle point
Returns:
returns true case possible calculate the middle line
 TL_DLL bool TeGenerateArc ( TePoint & p1, TePoint & p2, TePoint & p3, TeLine2D & arcOut, const short & NPoints )

Given three points returns a smooth arc as a TeLine2D that contains a given total number of points.

Parameters:
 p1 First point. p2 Second point. p3 Third point. arcOut The return arc. NPoints Number of arc points.

This algorithm is adapted from http://mathforum.org/dr.math/

 TL_DLL bool TeGenerateCircle ( const TePoint & center, const double & radius, TeLine2D & circle, const short & NPoints )

Given a center point and a radius, returns the circle as a TeLine2D interpolated by a given number of points.

Parameters:
 center Center point of the circle. radius radius of the circle. circle The return circle NPoints Number of circle points.
 TL_DLL bool TeGetCenter ( TePoint p1, TePoint p2, TePoint p3, TePoint & center )

Given three points of a circunference, returns its center point.

Parameters:
 p1 First point. p2 Second point. p3 Third point. center Circunference center. This algorithm is adapted from http://www.delphiforfun.org/Programs/Math_Topics/circle_from_3_points.htmbook.
 TL_DLL double TeGetRadius ( TePoint & p1, TePoint & p2, TePoint & p3 )

Given three points of a circunference, returns the radius.

Parameters:
 p1 First point. p2 Second point. p3 Third point. This algorithm is adapted from http://www.delphiforfun.org/Programs/Math_Topics/circle_from_3_points.htmbook.
 TL_DLL bool TeLineSimplify ( TeLine2D & line, double snap, double maxdist )

Performs a line simplication.

Parameters:
 line The line to be simplified snap Simplification threshold maxdist The maximum distance between intermediary segments