[pstricks] Automate a line drawing routine
David Arnold
dwarnold45 at suddenlink.net
Tue Dec 30 21:24:18 CET 2008
Herbert,
Case 1: (-1,-1), (2,4)
This is the case in your code. The line enters on the bottom boundary
and leaves on the top boundary.
Case 2: (-4,-2), (4,2)
The line enters on the left boundary and leaves on the right boundary.
Case 3: (-3,-4), (4,2)
The line enters on the bottom boundary and leaves on the right boundary.
Case 4: (-4,-2), (2,4)
The line enters on the left boundary and leaves on the top boundary.
Now, each of these could be handled as individual cases with the
ideas proposed in your code, but I'd like one set of code that could
be called with a macro such as:
\PositiveSlope{-1}{-1}{2}{4}
\PositiveSlope{-4}{-2}{4}{2}
\PositiveSlope{-3}{-4}{4}{2}
\PositiveSlope{-4}{-2}{2}{4}
Thanks.
David.
On Dec 30, 2008, at 11:50 AM, Herbert Voss wrote:
> David Arnold schrieb:
>
>> \DaveArnold{-1}{-1}{3}{2}
>
> that is no problem.
>
>> Can Herbert's code be adapted with an if...else something or other to
>> accommodate for the fact that the line might exit on the right or the
>> top boundary and might enter on the left or bottom entry? I can make
>> sure that the first point lies to the left and under the second point
>> in \DaveArnold, ensuring positive slope.
>
> please, give some example values for such a case
>
> Herbert
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
More information about the PSTricks
mailing list