ICurveTParam, TPointFlatten Method |
Namespace: DigitalRune.Mathematics.Interpolation
void Flatten( ICollection<TPoint> points, int maxNumberOfIterations, TParam tolerance )
Exception | Condition |
---|---|
ArgumentOutOfRangeException | tolerance is 0 or less than 0. |
This method computes a sequence of line segments which approximates the curve. For each line segment, the start and end point are added to points. For example, if a curve is approximated with two line segments (A, B) and (B, C) where A, B, C are three key points, then following points will be added to collection: A, B, B, C. This means, that duplicate points are added to the collection. The advantage of this is that the approximation can represent "gaps" in the curve. And it is easy to flatten several curves into the same points collection.
For some curves the approximation is computed with an iterative algorithm. The iterations end when the maxNumberOfIterations were performed, or when the tolerance criterion is met - whichever comes first.