[metapost] MetaFont: Unexpected behavior of intersections times

Boguslaw Jackowski B_Jackowski at GUST.org.pl
Fri Apr 8 19:13:38 CEST 2011


Hello, Everybody,

Dan Luecking:
> I once had two semicircles that crossed
> (theoretically) at the midpoint of each, and MP said
> they did not cross.

The only situation I can fancy is related to the inequality:

  (point t of p) transformed T <> point t of (p transformed T)

rather obvious in the realm of discrete geometry. Below an example:

% ===
path p,q; numeric a,t; pair s;

t=0.72302;

beginfig(100);

def T = scaled 100 enddef;
p:=(0,0){up}..{down}(1,0); q:=p shifted point t of p; p:=p T; q:=q T;
show q intersectiontimes p;

draw p withcolor blue;
draw q withcolor blue;

def T = scaled 100 rotated a shifted s enddef;
a=67.43527; s=(0.66753,0.5755); 
p:=(0,0){up}..{down}(1,0); q:=p shifted point t of p; p:=p T; q:=q T;
show q intersectiontimes p;

draw p withcolor red;
draw q withcolor red;

endfig;

end.
% ===

Rounding errors cause that the curves p and q after the same shift
and rotation become ("infinitesimally") disjoint. But I'm not sure
whether Dan observed a situation of this kind.

Cheers -- Jacko

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
----------------------------------------------------------------
  Hofstadter's Law: It always takes longer than you expect, even
                    when you take into account Hofstadter's Law.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the metapost mailing list