11.01.2015 Views

CLIM 2 User Guide

CLIM 2 User Guide

CLIM 2 User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This function is equivalent to calling draw-rectangle repeatedly, but it can be more convenient<br />

and more efficient when drawing more than one rectangle. See the function drawrectangle.<br />

draw-rectangles*<br />

[Function]<br />

Arguments: medium coord-seq &key (filled t) line-style line-thickness<br />

line-unit line-dashes line-joint-shape ink clipping-region<br />

transformation<br />

■ Draws a set of axis-aligned rectangles on medium. coord-seq is a sequence of 4-tuples x1,<br />

y1, x2, and y2, with (x1,y1) at the upper left and (x2,y2) at the lower right in the standard +Y-downward<br />

coordinate system.<br />

This function is equivalent to calling draw-rectangle* repeatedly, but it can be more convenient<br />

and more efficient when drawing more than one rectangle. See the function drawrectangle*.<br />

Both draw-rectangles* and draw-rectangles call medium-draw-rectangles* to do<br />

the actual drawing.<br />

draw-ellipse<br />

[Function]<br />

Arguments: medium point-1 radius-1-dx radius-1-dy radius-2-dx<br />

radius-2-dy &key start-angle end-angle (filled t)<br />

line-style line-thickness line-unit line-dashes<br />

line-cap-shape ink clipping-region transformation<br />

IMPLEMENTATION LIMITATION: Because of limitations in X, only ellipses with axes<br />

aligned with the X and Y axes will be drawn. If you specify an ellipse with other axes, X (and thus<br />

<strong>CLIM</strong>) will draw an ellipse with aligned axes anyway.<br />

■ Draws an ellipse or elliptical arc on medium. The center of the ellipse is specified by point.<br />

This function is the same as draw-ellipse*, except that the center position is expressed as<br />

a point instead of x and y. See the function draw-ellipse*.<br />

■ Two vectors, radius-1-dx, radius-1-dy, and radius-2-dx, radius-2-dy specify<br />

the bounding parallelogram of the ellipse. Those two vectors must not be collinear in order for the<br />

ellipse to be well defined. The special case of an ellipse with its major axes aligned with the coordinate<br />

axes can be obtained by setting both radius-1-dy and radius-2-dx to 0. For more information<br />

about the bounding parallelogram of an ellipse, see the section 3.6.8 Ellipses and elliptical<br />

arcs in <strong>CLIM</strong>.<br />

start-angle and end-angle enable you to draw an arc rather than a complete ellipse.<br />

Angles are measured with respect to the positive x axis. The elliptical arc runs positively from<br />

start-angle to end-angle. The angles are measured from the positive x axis toward the positive<br />

y axis. In a right-handed coordinate system this direction is counter-clockwise.<br />

The defaults for start-angle and end-angle are nil (that is, there is no default). If you<br />

supply start-angle, then end-angle defaults to 2π. If you supply end-angle, then<br />

start-angle defaults to 0.<br />

filled specifies whether the ellipse should be filled, a boolean value.<br />

In the case of a filled arc, the figure drawn is the pie slice area swept out by a line from the center<br />

of the ellipse to a point on the boundary as the boundary point moves from start-angle to endangle.<br />

When drawing unfilled ellipses, the current line style affects the drawing as usual, except that the<br />

joint shape has no effect. The dashing of an elliptical arc starts at start-angle.<br />

34 <strong>CLIM</strong> 2.2 <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!