# how to draw a quadratic/cubic bezier curve in inkscape?

Suppose I have these control points in Inkscape

I want to draw two curves, one is a quadratic bezier curve, the other is a cubic bezier curve.

We know they are:

`q=(1-t)^2 * p0 + 2 * t * (1-t) * p1 + t^2 * p2`

`c=(1-t)^3 * p0 + 3 * t * (1-t)^2 * p1 + 3 * (1-t) * t^2 * p2 + t^3 p3`

I used the Inkscape bezier tool, but the curve doesn't seem to be the one I want. Does any one know how to draw these two curves precisely?

As for quadratic curves, I don't think there is an easy way to draw them with Inkscape's drawing tools (there is a BSpline-mode, but that's not quite the same). However, you can use the 'Edit → XML Editor...' to manually edit the path-data in the `d`-attribute, entering your coordinates and using the 'q/Q' commands:
In this example, the `m 100,80` part is the coordinates of P0, then `Q 222,106` for P1 and the last pair (`311,-31`) is P2.
By the way, this method also lets you directly specify cubic curves with the 'c/C' commands (e.g. something like `m 100,50 C 150,50 150,200 50,200`).