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

◆ estimateMaxDistance()

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

Definition at line 320 of file line_simplification.h.

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

References fl::span< T, Extent >::size(), fl::sqrt(), 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: