Go to the first, previous, next, last section, table of contents.

Slanted lines and vectors

The macros \drawline and \drawvector provide the capability found in LaTeX's picture mode to draw slanted lines and vectors of certain directions. Both of these macros take three arguments: two integer arguments to specify the direction of the line or vector, and one argument to specify its length. For example, `\drawvector(-4,1){60pt}' produces the vector which lies in the 2d quadrant, has a slope of minus 1/4, and a width of 60 pt.

Note that if an \hbox is placed around \drawline or \drawvector, then the width of the \hbox will be the positive dimension specified in the third argument, except when a vertical line or vector is specified, e.g., \drawline(0,1){1in}, which has zero width. If the specified direction lies in the 1st or 2d quadrant (e.g., (1,1) or (-2,3)), then the \hbox will have positive height and zero depth. Conversely, if the specified direction lies in the 3d or 4th quadrant (e.g., (-1,-1) or (2,-3)), then the \hbox will have positive depth and zero height.

There are a finite number of directions that can be specified. For \drawline, the absolute value of each integer defining the direction must be less than or equal to six, i.e., (7,-1) is incorrect, but (6,-1) is acceptable. For \drawvector, the absolute value of each integer must be less than or equal to four. Furthermore, the two integers cannot have common divisors; therefore, if a line with slope 2 is desired, say (2,1) instead of (4,2). Also, specify (1,0) instead of, say, (3,0) for horizontal lines and likewise for vertical lines.

Finally, these macros depend upon the LaTeX font line10. If your site doesn't have this font, ask your system administrator to get it. Future enhancements will include macros to draw dotted lines and dotted vectors of various directions.


Go to the first, previous, next, last section, table of contents.