FastLED 3.9.15
Loading...
Searching...
No Matches

◆ estimateMaxDistance()

template<typename NumberT = float>
static NumberT fl::LineSimplifierExact< NumberT >::estimateMaxDistance ( const fl::Slice< const Point > & polyLine)
inlinestaticprivate

Definition at line 319 of file line_simplification.h.

319 {
320 // Rough guess: max distance between endpoints
321 if (polyLine.size() < 2)
322 return 0;
323
324 const Point &first = polyLine[0];
325 const Point &last = polyLine[polyLine.size() - 1];
326 NumberT dx = last.x - first.x;
327 NumberT dy = last.y - first.y;
328 return sqrt(dx * dx + dy * dy);
329 }

References fl::Slice< T >::size(), fl::vec2< T >::x, and fl::vec2< T >::y.

Referenced by simplify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: