Curve Curve::bezier(const std::initializer_list<Point>& keyPoints, Uint32 complexity) { Curve curve; if( complexity < 2 ) complexity = 2; std::vector<Point> keys = keyPoints; for( Uint32 k(0); k < complexity + 1; k++ ) { Point point; for( size_t i(0); i < keyPoints.size(); i++ ) point+=(keys[i] * Math::bernstein(i, keys.size() - 1, float(k) / float(complexity))); curve.addVertex(point); } return curve; }