From: Michael SCHINDLER <m-schindler@us...> - 2011-07-16 08:05:01
Salut André and Jörg,
On 14/07/11, André Wobst wrote:
> Right, but compared to similar situations in PyX the path
> constructor is already feels inconsistent. [...]
> Anyway, I do not consider this to be a good argument that we should
> not require a list explicitly instead of multiple arguments.
According to yours and Jörg's opinion on that, I changed the arguments
of metapost.path to be a list of knots/links. It also eats an epsilon
which is a property of the module.
> Right. I just had a quick look at the code. From what I've
> understood, mp_make_choices removes tiny segments. This it should be
> a similar situation like in the normpath construction. Thus my vague
> idea that it could be a similar case.
> mp_solve_choices seems quite different as it compares to unity. This
> is similar to graph coordinates, where you compare to one to decide
> whether a point is at the axis or not. To be numerically stable
> (like not extending the axis range when you slightly exceed the axis
> range by up to 1e-10 in graph coordinates), an epsilon is required.
> Without understanding any of the details of mp_solve_choices, it
> might be a similar situation.
> There are
> reasons why we could have two epsilons while metapost does have one
> only. We do have a quite different situation than metapost as we use
> floats. We can have almost arbitrary precision when getting close to
> zero. Take 1e-100, such a number far from being expressable by
> metapost. On the other hand we have units and points and there are
> points which are close to each other (like when comparing to 1e-5
> postscript points, like we're doing in the normpath).
This epsilon is used only in make_choices, to throw away too short
elements, and to determine the orientation of a path. It is not,
however, used in solve_choices. I checked all positions where numbers
are compared to unity, and all were continuous functions where a small
numerical error will result in a negligible change of the control
points of curves. Your example in the graph is obviously
I did a checkin to keep track of these changes only, and then proceed
with eliminating the mp_* helper functions which do only a
multiplication or a division, ...
These are relicts of the integer numerics in metapost (as were the
comparisons with unity).