# [Tugindia] psbezier

E. Krishnan ekmath at asianetindia.com
Sun Aug 14 05:20:07 CEST 2005

On Fri, 12 Aug 2005, Ravi Gautam wrote:

> I am confused about psbezier. It takes more than 4 control points
> without any problem. But It gives error output for 3 and lesser number
> of control points.

By definition, the command "\psbezier" draws a curve dtermined by
\emph{four} specified points, using a \emph{cubic} polynomial (called the
Berstien polynomial). Some experiments with this command gave these
results.

If only three points are specified, the origin (0,0) is taken as the first
point to compute this polynomial. If only two points are specified, the
origin is taken as the first point and the last point given is taken as
the third \emph{and} fourth points to compute the polynomial.

IF more than four points are specified, various Bezier curves are drawn
and pasted together like this: the last four points are used to draw a
Bezier curve, then the four points ending at the first of the last four
points are used to draw another curve and so on.

Thus

\psbezier(1,2)(2,2)(2,3)(4,3)(5,1)(6,2)(7,2)(8,1)

is equivalent to

\psbezier(5,1)(6,2)(7,2)(8,1)
\psbezier(2,2)(2,3)(4,3)(5,1)
\psbezier(0,0)(1,2)(2,2)(2,2)

--
Krishnan