maxtimes returns times which aren't the maximum point.
If I understand thier specification correctly, it is a bug.
% cat tst.asy
path p = (0,0)--(1,1);
write(point(p, 0));
write(point(p, 1));
real[] ts = maxtimes(p);
write(ts[0]);
write(ts[1]);
% asy tst.asy
(0,0)
(1,1)
0
0
I think ts[0] and ts[1] should be 1 because point(p, 1)=(1,1) is bigger than point(p, 0)=(0,0) in horizontal and vertical.
Similar problem exists with mintimes.
% cat tst2.asy
path p = (1,1)--(0,0);
write(point(p, 0));
write(point(p, 1));
real[] ts = mintimes(p);
write(ts[0]);
write(ts[1]);
% asy tst2.asy
(1,1)
(0,0)
0
0
I think ts[0] and ts[1] should be 1 because point(p, 1)=(0,0) is bigger than point(p, 0)=(1,1) in horizontal and vertical.
% asy --version
Asymptote version 1.76 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]
Thanks; fixed in svn and upcoming release.
Thank you for very quick response.
I built asy from svn trunk.
The exact problems I reported is fixed.
But a similar problem remain.
% cat tst.asy
path p = (-1,1)--(-1,-1)--(1,-1)--(2,2)--(3,3);
real[] ts = maxtimes(p);
pair p0 = point(p, ts[0]);
pair p1 = point(p, ts[1]);
write(p);
write(ts);
write(p0);
write(p1);
size(10cm);
draw(p);
dot(p0, blue);
dot(p1, red);
label("0", p1, NE);
label("1", p1, SW);
% ./asy -V tst.asy
(-1,1)--(-1,-1)--(1,-1)--(2,2)--(3,3)
0: 1
1: 1
(-1,-1)
(-1,-1)
(-1,-1) is not the maximum point.
The maximum point is (3,3) for both horizontal and vertical.
Sorry, my first fix was correct only for paths of length 1. Try svn r4394.
Great. No problem now.