FPIC Operations

These are the user-level functions defined in FPIC. The most important type is Picture. Users will also use operations on real numbers and on Points.

Lengths are given in centimeters.

Basic pictures

In addition to drawing the pictures, these operations also create environments naming the points of that picture corresponding to compass directions. These points are called n, s, e, w, ne, se, nw, and sw, as well as center. Where indicated, some additional points may be automatically named. Users can add additional named points as well as named subpictures using the operations in the environments section.

Lines

These are mainly functions from pairs of points to pictures. In addition to the compass points (which don't really make that much sense for lines), the have named points start, end, and midpoint.

Transformations

Transformations are translation, rotation, scaling, changes of color, and other stuff. Many of these transformations come directly from pstricks.

There is a fine line between translation operations, in which a picture is moved, and sequencing operations, in which two pictures are drawn together, with one of them usually being moved. We have placed operations that move a single picture here, and operations that combine two pictures, even when they involve a translation of one of the pictures, in the section on sequencing operations.

Picture-combining (sequencing) operations

These operations create compound pictures. (We call these sequencing operations.)

  • seq: Picture * Picture -> Picture (infix). Draw both pictures.
  • hseq: Picture * Picture -> Picture (infix). Draw the two pictures right next to one another.
  • vseq: Picture * Picture -> Picture (infix). Draw the first picture on top of the second.
  • cseq: Picture * Picture -> Picture (infix). Draw both pictures, with their centers aligned.
  • hseqsp, vseqsp: Picture * real -> Picture -> Picture (infix). Like hseq and vseq, but with a gap added.
  • align: (Picture * Point) * (Picture * Point) -> Picture (infix). Draw the two pictures such that the two points coincide.
  • tile: (Picture * Picture -> Picture) -> int -> Picture -> Picture. tile f n pic draws n copies of pic, connected by f.
  • stick: int -> Picture -> Picture. stick n pic draws n copies of pic right next to one another.
  • stack: int -> Picture -> Picture. stick n pic draws n copies of pic on top of one another.
  • connect: Picture -> Picture -> (Point * Point -> Picture) -> Picture. connect p q f draws p, q, and f(p,q). The intention is that f is a "line function."
  • mkseqfun: (Picture -> Point) -> (Picture -> Point) -> Picture * Picture -> Picture. mkseqfun f g returns a function that draws pictures p and q so that (f p) and (g q) coincide.
  • mkseqlist: SequenceOp -> Picture list -> Picture. A SequenceOp is a function in Picter * Picture -> Picture. mkseqlist op pics draws all the pics using op to combine them. It is basically fold.
  • seqlist, hseqlist, vseqlist, cseqlist: Picture list -> Picture. Combine a list of pictures using the indicated sequencing operator.
  • lineseq: Picture * Picture -> Picture (infix). Sequences two lines, drawing the second line so that its start point coincides with the end point of the first line.
  • lineseqlist: Picture list -> Picture.

    Environment-oriented operations

    These operations relate to naming and numbering of pictures. All pictures come with some of their points named, as described above. Users may add additional named points using the operations listed here. Note that named points are transformed long with the picture itself, so that point "s" may not be south at all, if the picture has been rotated. To get "true" south, or any other point, use operations boundingBox and related operations like north and center, which are also included in this section.

    An irritating subtlety here has to do with numbering of subpictures. Since all operations are binary, it would seem that every compound picture would have only two subpictures, which is counterintuitive, so the combining operations listed above will generally "flatten" the environment structure. On the other hand, some structure is desirable. So, the group operation prevents the flattening of that picture within a larger picture. For example, p1 seq p2 seq p3 has three subpictures (numbered 1, 2, and 3), while p1 seq (group (p2 seq p3)) has two subpictures, the second of which has two subpictures. When named pictures are added using addNamedPic or addNamedPics, they are automatically grouped.

    Colors

    Colors are just triples of real numbers (RGB values) between 0 and 1. The predefined colors are:

    Point operations

    These operations create points, which are pairs of real's, or otherwise manipulate them.

    • ++: Point * Point -> Point (infix).
    • --: Point * Point -> Point (infix).
    • **: Point * Point -> Point (infix).
    • //: Point * Point -> Point (infix).
    • distance: Point -> Point -> real.
    • midpoint: Point -> Point -> Point.