[metapost] New number systems compute cyclic path strangely

Toby Thurston thurston at eml.cc
Sun Apr 28 17:21:12 CEST 2024


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


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.....

The original poster as TeX.SE was using MP 2.02 but I I see this behaviour with  MetaPost, version 2.10 (TeX Live 2024).

Toby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20240428/56466037/attachment.htm>


More information about the metapost mailing list.