How can I find the point(s) where the tangent to a Bézier is horizontal?

262 Views Asked by At

I am working on cubic Béziers, and need to find the points where the tangent to the curve is vertical or horizontal.

So far I've managed to:

  • convert the Bézier to a cubic polynomial
  • find the derivative
  • find the root(s) of the derivative

This should give me the points in x/y space where the cubic Bézier is horizontal.

I am now having trouble:

  • converting the roots back to the 0 >= t <= 1 space
  • figuring how to find the vertical point(s)

Before I resort to approximation (i.e.: walking through the curve and finding the vertical/horizontal spots) I want to ask if there is any analytical method.

I haven't touched calculus seriously since the last century, and this is a hobby project, so have mercy, please.

I am using python/numpy to solve this - any hints in that direction are helpful but not necessary. I think that once figured out the math aspect I can dig up the implementation.

1

There are 1 best solutions below

0
On

This should give me the points in x/y space where the cubic Bézier is horizontal.

No, if you solve $y’(t)=0$ it will give you the parameter values ($t$) where the tangent is horizontal.

You must be solving the wrong equation. If you show us what you did, I expect we can spot the problem.