HELP APPPOLYGON                                     David Young
                                                    April 1998

LIB * APPPOLYGON (note 3 "p"s as in appproperty) allows a procedure to
be applied to every integer-coordinate point (i.e. every pixel in image
processing terms) inside a polygon or on its boundary.

apppolygon(x1, y1, x2, y2, ... xn, yn, n, proc)

        x1, y1, ... xn, yn are the coordinates of the vertices of the
        polygon, in order (clockwise or anticlockwise round the
        polygon). n is the number of vertices, and so must be equal to
        half the number of preceding arguments.

        proc is a procedure of two arguments

                proc(x, y)

        which is called for every pair of integer coordinates inside the
        polygon or on its boundary.

        A point is inside the polygon if, to reach it from outside the
        polygon's bounding box, you have to cross an odd number of the
        polygon's edges.

For an example, see the commented-out code at the end of
LIB*APPPOLYGON.


--- $popvision/help/apppolygon
--- Copyright University of Sussex 1998. All rights reserved.
