Re: Limit of arclength when calculating intersectiontimes ?

luigi scarso <[email protected]> Wed, 23 Apr 2025 13:37:41 +0200
Newsgroups gmane.comp.tex.metapost
Message-ID <CAG5iGsBDKPzqX1wcxvrMKi-D0xAd3EKDm2ohsUCGQuaVdzY4PA@mail.gmail.com>
--===============1137701543061949830==
Content-Type: multipart/alternative; boundary="0000000000001e7a8606337088d7"

--0000000000001e7a8606337088d7
Content-Type: text/plain; charset="UTF-8"

On Wed, 23 Apr 2025 at 12:43, Toby Thurston <[email protected]> wrote:

> Can I draw your attention to this question on TeX.SE?
>
> https://tex.stackexchange.com/q/741317/15036
>
> Apparently MP fails to calculate `intersectiontimes` if either path has a
> `arclength` > 32767.99997 regardless of the number system being used.
>
> Is this limit of `2**15-epsilon` baked in somewhere?
>
> Toby
>
>
$>mpost -numbersystem=binary test.mp

%%  test.mp
numberprecision:=72;
show numbersystem; % should be binary

d=0.999999999999;
path p,q; pair r;

p=origin--(800,0);
q=(400,-16383-d)--(400,16383+d);

r=p intersectiontimes q; show r; % shows (-1,-1) ???????

end

 it's still ok, but  d=0.9999999999999; fails.

It's worth checking out.

--
luigi

--0000000000001e7a8606337088d7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, 23 Apr =
2025 at 12:43, Toby Thurston &lt;<a href=3D"mailto:[email protected]">thursto=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">Can I draw your attention to this question on TeX.SE?<br>
<br>
<a href=3D"https://tex.stackexchange.com/q/741317/15036" rel=3D"noreferrer"=
 target=3D"_blank">https://tex.stackexchange.com/q/741317/15036</a><br>
<br>
Apparently MP fails to calculate `intersectiontimes` if either path has a `=
arclength` &gt; 32767.99997 regardless of the number system being used.<br>
<br>
Is this limit of `2**15-epsilon` baked in somewhere?<br>
<br>
Toby<br>
<br></blockquote><div><br></div><div>$&gt;mpost -numbersystem=3Dbinary <a h=
ref=3D"http://test.mp">test.mp</a></div><div><br></div><div>%%=C2=A0 <a hre=
f=3D"http://test.mp">test.mp</a></div><div>numberprecision:=3D72;<br>show n=
umbersystem; % should be binary<br><br>d=3D0.999999999999;<br>path p,q; pai=
r r;<br><br>p=3Dorigin--(800,0);<br>q=3D(400,-16383-d)--(400,16383+d);<br><=
br>r=3Dp intersectiontimes q; show r; % shows (-1,-1) ???????<br><br>end</d=
iv><div><br></div><div>=C2=A0it&#39;s still ok, but=C2=A0=C2=A0d=3D0.999999=
9999999; fails.</div><div><br></div><div>It&#39;s worth checking out.</div>=
<div><br></div><div>--</div><div>luigi</div></div></div>

--0000000000001e7a8606337088d7--

--===============1137701543061949830==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
http://tug.org/metapost/

--===============1137701543061949830==--