# Thread: How to find normal vector of quadatic bezier curve, curvature of bezier curve.

1. ## How to find normal vector of quadatic bezier curve, curvature of bezier curve.

Hello. How to find normal vector of quadatic bezier curve, curvature of quadratic bezier curve.

2. ## Re: How to find normal vector of quadatic bezier curve, curvature of bezier curve.

According to Wikipedia, a quadratic Bezier curves are given by begin/end points $\displaystyle \vec{P_0}, \vec{P_2}$, and a control point, $\displaystyle \vec{P_1}$:

$\displaystyle \vec{B}(t) = (1-t)^2\vec{P_0} + 2(1-t)t\vec{P_1} + t^2\vec{P_2}, \ t \in [0,1]$.

From there, I let $\displaystyle \vec{u} = \vec{P_0} - \vec{P_1}$, and $\displaystyle \vec{v} = \vec{P_2} - \vec{P_1}$, giving

$\displaystyle \vec{B}(t) = \vec{P_1} + (1-t)^2\vec{u} + t^2\vec{v}, \ t \in [0,1]$, and

$\displaystyle \frac{d\vec{B}(t)}{dt} = -2(1-t)\vec{u} + 2t\vec{v}, \ t \in [0,1]$.

Thus one normal would be $\displaystyle \vec{N}(t) = (-(1-t)\vec{u}_y + t\vec{v}_y)\hat{i} - (-(1-t)\vec{u}_x + t\vec{v}_x) )\hat{j}, \ t \in [0,1]$, and

the signed curvature is $\displaystyle k = \frac{<\vec{u} \times \vec{v}, \hat{k}>}{2 \left[ \ \lVert\vec{u}+\vec{v}\rVert^2 \ t^2 - 2 (\Vert\vec{v}\rVert^2 + <\vec{u}, \vec{v}>) \ t + \Vert\vec{v}\rVert^2 \ \right]^{3/2}}$.

Note: $\displaystyle <\vec{u} \times \vec{v}, \hat{k}>$ is just a vector way of writing $\displaystyle \vec{u}_x \vec{v}_y - \vec{u}_y \vec{v}_x$.

I also pulled the formula for the signed curvature off wikipedia, though that should be easy to find everywhere.

I certainly could have made a mistake somewhere, so I'd suggest you work it out yourself. If you get the same thing, then it's a good bet neither of us made a mistake.