mathandy / svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
MIT License
557 stars 142 forks source link

Bezier curve inflection points #39

Closed 0x1af closed 6 years ago

0x1af commented 6 years ago

Hi,

First of all, thank you for the svgpathtools. It has saved me lots of time.

Really just a small issue. I did not see a convenient way to obtain the inflection points of a bezier curve. @mathandy, Would you accept a contribution for that?

All the best, olaf

mathandy commented 6 years ago

If you want to find where the second derivative is zero, one way would be:

import numpy as np
c = CubicBezier(0,1+2j, 2-j, 1)
np.roots(c.poly().deriv(2))