[pstricks] Automate a line drawing routine

David Arnold dwarnold45 at suddenlink.net
Mon Dec 29 20:17:25 CET 2008


All,

I'd like to produce some line graphs, such as:

http://www.kutasoftware.com/FreeWorksheets/Slope%20From%20a%20Graph.pdf

Now, I can produce these one at a time, not much problem, but I'd  
like to automate the task a bit:

1. I like the domain to be [-5,5], and the range [-5,5]. I'd like the  
x-axis labeled -5 and 5 at each end, same for the y-axis. I'd like  
the x- and y-axes labeled at the right and top ends with "x" and "y",  
respectively.

2. The user can easily choose two points P and Q on the grid.

3. The code automatically determines the equation of the line through  
P and Q (no horizontal or vertical allowed) and then clips it to the  
domain and range in item #1. The line should be drawn with arrowheads  
at each end of the line.

Looking for ideas.

Thanks.

David.


More information about the PSTricks mailing list