[metapost] intersectiontimes

Dan Luecking luecking at uark.edu
Thu Oct 16 21:45:07 CEST 2008


At 04:45 PM 10/15/2008, Troy Henderson wrote:
>Try this:
>
>--- begin cut code ---
>
>path p,q,r;
>p:=fullcircle xscaled 72 yscaled 36;
>q:=fullcircle xscaled 36 yscaled 72;
>r:=p;
>draw p withcolor green;
>draw q withcolor red;
>for n=1 upto 4:
>    (t[n],whatever) = r intersectiontimes q;

  % in a general purpose macro one might want:
     exitif t[n]<0;

>    z[n] = point t[n] of r;
>    r:= subpath (t[n]+epsilon,length r) of r;
>    fill fullcircle scaled 2 shifted z[n] withcolor blue;
>endfor;


Dan

Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
"Dubito ergo cogito, cogito ergo sum" --Descartes



More information about the metapost mailing list