If I have a cubic bezier curve $B(t)$, I know that to get the tangent of the curve $B(t)$, just take the derivative of it. However, what if I'm looking for the tangent at one of the endpoints, how do I go about getting it?
Thanks.
If I have a cubic bezier curve $B(t)$, I know that to get the tangent of the curve $B(t)$, just take the derivative of it. However, what if I'm looking for the tangent at one of the endpoints, how do I go about getting it?
Thanks.
On
As the comment said, the end tangents are parallel to the vectors $B'(0)$ and $B'(1)$. If the Bezier curve has degree $m$, and its control points are $\mathbf{P}_0, \ldots, \mathbf{P}_m$, then $$ B'(0) = m(\mathbf{P}_1 - \mathbf{P}_0) $$ $$ B'(1) = m(\mathbf{P}_m - \mathbf{P}_{m-1}) $$ So, the start tangent is parallel to the line through the first two control points, and the end tangent is parallel to the line through the last two control points.
Th most common case is $m=3$ (cubic Bezier curves).
The line through the first two control points is tangent to the curve, as is the line through the last two control points, i.e., the curve is tangent to the first and last segments of the Bézier polygon. This is true for any order Bézier curve.