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)
 Adjust Segment to specific distance.
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 
)

Adjust Segment to specific distance.

Parameters:
P0first coordinate
P1second coordinate
d0distance value to adjust
P0outfirst coordinate adjusted
P1outsecond 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:
lineThe Line to calculate the middle point
pmiddle 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:
p1First point.
p2Second point.
p3Third point.
arcOutThe return arc.
NPointsNumber 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:
centerCenter point of the circle.
radiusradius of the circle.
circleThe return circle
NPointsNumber 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:
p1First point.
p2Second point.
p3Third point.
centerCircunference 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:
p1First point.
p2Second point.
p3Third 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:
lineThe line to be simplified
snapSimplification threshold
maxdistThe maximum distance between intermediary segments
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines