11.01.2015 Views

CLIM 2 User Guide

CLIM 2 User Guide

CLIM 2 User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

polygon-points<br />

Arguments: polygon<br />

■ Returns a sequence of points that specify the segments in polygon.<br />

map-over-polygon-coordinates<br />

Arguments: function polygon<br />

[Generic function]<br />

[Generic function]<br />

■ Applies function to all of the coordinates of the vertices of polygon. The function takes<br />

two arguments, the x and y coordinates.<br />

map-over-polygon-segments<br />

Arguments: function polygon<br />

[Generic function]<br />

■ Applies function to the line segments that compose polygon. The function takes four<br />

arguments, the x and y coordinates of the start of the line segment, and the x and y coordinates of the<br />

end of the line segment.<br />

■ When map-over-polygon-segments is called on a closed polyline, it will call function<br />

on the line segment that connects the last point back to the first point.<br />

3.6.5 Lines in <strong>CLIM</strong><br />

A line is a special case of a polyline that has only a single segment. The functions for making and dealing<br />

with line are the following:<br />

line<br />

[Class]<br />

■ The protocol class that corresponds to a mathematical line-segment, that is, a polyline with only<br />

a single segment. This is a subclass of polyline. If you want to create a new class that obeys the<br />

line protocol, it must be a subclass of line.<br />

standard-line<br />

[Class]<br />

■ A class that implements a line. This is a subclass of line. This is the class that make-line and<br />

make-line* instantiate.<br />

make-line<br />

Arguments:<br />

start-point end-point<br />

[Function]<br />

■ Makes an object of class standard-line that connects start-point to end-point.<br />

make-line*<br />

Arguments: start-x start-y end-x end-y<br />

[Function]<br />

■ Makes an object of class standard-line that connects (start-x, start-y) to(end-x,<br />

end-y).<br />

line-start-point<br />

Arguments: line<br />

■ Returns the starting point of line.<br />

line-end-point<br />

Arguments: line<br />

■ Returns the ending point of line.<br />

[Generic function]<br />

[Generic function]<br />

48 <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!