Re: New number systems compute cyclic path strangely

Hans Hagen <[email protected]> Sun, 28 Apr 2024 19:16:19 +0200
Newsgroups gmane.comp.tex.metapost
Message-ID <[email protected]>
On 4/28/2024 5:21 PM, Toby Thurston wrote:
> This recent question on TexSE seems to have uncovered an anomaly in the 
> way that MP computes the `arclength` of cyclic paths when using any of 
> the new number systems.
> 
> https://tex.stackexchange.com/q/716630/15036 
> <https://tex.stackexchange.com/q/716630/15036>
> 
> 
> The poster supplied this example code
> 
> beginfig(1);
> path p;
> p = (0,0){up}..{right}(200,100)..{up}(300,400)..cycle;
> len := arclength p;
> s := arctime (2500) of p;
> t := arctime (len+2500) of p;
> draw p;
> show len;% 2799
> show s;% 2.92...
> show t;% 2.67...
> show arctime arclength p of p;
> show numbersystem;
> 
> endfig;
> end
> 
> With the default number system the value of t is 5.92... as you might 
> expect, but with any of the new number systems the value is 2.67.....

fwiw: len (2800) + 2500 also exceeds 4096 which is scaled max so the 
fact that scaled works is kind of a miracle


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

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