67.1.2 Curves

A regular curve is a set of pixels on a raster display (or dots on a page of printer paper) that define the perimeter (or part of the perimeter) of a conic section. An irregular curve is a set of pixels that define a curve which does not fit the perimeter of a conic section. (In Windows, the endpoint is excluded from a curve just as it is excluded from a line.)

When an application calls one of the Windows curve-drawing functions, the graphics engine breaks the curve into a number of extremely small, discrete line segments. After determining the endpoints for each of these line segments, the graphics engine determines which pixels (or dots) define each line by applying its DDA.

An application can draw an ellipse or part of an ellipse by calling the Arc function. This function draws the curve within the perimeter of an invisible rectangle that is called a bounding rectangle, the size of the ellipse is specified by two invisible radial lines which are drawn from the center of the rectangle to the edges of the rectangle. The following illustration shows part of an ellipse that was drawn using the Arc function:

Arc, Bounding-Rectangle, and Radials

(When an application calls the Arc function, it specifies the coordinates of the bounding rectangle and radial lines. The previous illustration showed the rectangle and radials with dashed lines while the actual arc was drawn using a solid line.)

In addition to ellipses or parts of ellipses, Windows applications can draw irregular curves called Bezier splines. (Originally, the term spline referred to a tool used by draftsmen to draw irregular curves. With the development of graphical interfaces, however, the term has come to refer to the curve itself.) A Bezier spline is an irregular curve with the following characteristics: the curvature of the spline is defined by four control points (p1, p2, p3, and p4). The control points p1 and p4 define the starting- and ending-points of the curve while the control points p2 and p3 define the shape of the curve. The following illustration shows two Bezier curves, their starting points, ending points, and control points:

Bezier Splines

An application can draw irregular curves by calling the PolyBezier function and supplying the appropriate control points.