(texdraw)Bezier curves


Next: Fill commands Prev: Circles and arcs Up: TeXdraw Commands
Enter node , (file) or (file)node

2.8 Bezier curves
=================

Bezier curves in TeXdraw use 4 reference coordinates, two as the end
points and two others to control the shape of the curve.  Let the 4
points be '(X0 Y0)', '(X1 Y1)', '(X2 Y2)' and '(X3 Y3)'.  The curve
starts out tangent to the line joining the first two points and ends up
tangent to the line joining the second two points.  The control points
"pull" at the curve to control the curvature.  The amount of pull
increases with the distance of the control point from the endpoint.

   As the parameter u varies from 0 to 1, the coordinates of the Bezier
curve are given by a pair of parametric cubic equations,

x(u) = (1-u)^3 x0 + 3u (1-u)^2 x1 + 3u^2 (1-u) x2 + u^3 x3 y(u) =
(1-u)^3 y0 + 3u (1-u)^2 y1 + 3u^2 (1-u) y2 + u^3 y3 .

'\clvec (X1 Y1)(X2 Y2)(X3 Y3)'
     Draw a Bezier curve from the current position to the coordinate
     '(X3 Y3)' which becomes the new current position.  The coordinates
     '(X1 Y1)' and '(X2 Y2)' serve as control points for the curve.
     Only the last coordinate given is used to update the size of the
     drawing.
Note that only 3 coordinate pairs are specified.  The other point is the
current position before the '\clvec' command is executed.  Only the last
coordinate specified in the '\clvec' command is used to determine the
extent of the drawing.  While the Bezier curve passes through the old
current position and the new current position, in general the curve will
not reach the intermediate control points.  The curve is always entirely
enclosed by the convex quadrilateral defined by the two end points and
the two control points.  Note that the curve may pass outside the limits
of the drawing as determined by the end point of the curve.

   A simple Bezier curve is produced by the following example.
     \btexdraw
       \move (0 0)
       \clvec (0 1)(1 0)(1 1)
     \etexdraw


automatically generated by info2www version 1.2.2.9