[NTG-context] Metapost: directionpoint gives unexpected point(?)
mickep at gmail.com
Fri Feb 5 17:51:19 CET 2021
I was too quick to push send. This must be some rounding error.
Changing the instance fixes the problem. Sorry for the noise.
On Fri, Feb 5, 2021 at 5:48 PM Mikael Sundqvist <mickep at gmail.com> wrote:
> I get sometimes the wrong directionpoint. In the example below it
> works for all values of direx except between 0 and 90. If I put direx
> to something in this interval, it seems that the point between cs and
> cl are chosen.
> Is there a better way to construct the paths not to get this problem?
> Or some other way out?
> path cl,cs,rl,p;
> z0 = (0,6/sqrt(3)*u);
> z1 = z0 rotated 120;
> cs := (fullcircle scaled 16u) shifted z1;
> cs := cs cutafter point 1/6 along cs;
> cl := (fullcircle scaled 4u) shifted z0;
> cl := cl cutbefore point 1/6 along cl cutafter point 2/6 along cl;
> p = cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated
> 240) .. (cl rotated 240) .. cycle;
> draw p;
> drawarrow cs withcolor darkblue;
> drawarrow cl withcolor darkred;
> z11=directionpoint dir(direx) of p;
> drawarrow ((-u,0)--(u,0)) rotated direx shifted z11;
More information about the ntg-context