summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/graph3.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-18 18:40:50 +0000
committerKarl Berry <karl@freefriends.org>2023-02-18 18:40:50 +0000
commit14e4f63a357437636c6cb5c2130c3865c0079ef3 (patch)
treedf263fab51006eea4be1bc1c481a07304401326f /Master/texmf-dist/asymptote/graph3.asy
parent7f326f6942dc81b97699f20698fe017b15ef74fa (diff)
asymptote 2.85 support files, windows binaries
git-svn-id: svn://tug.org/texlive/trunk@65878 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/graph3.asy')
-rw-r--r--Master/texmf-dist/asymptote/graph3.asy22
1 files changed, 13 insertions, 9 deletions
diff --git a/Master/texmf-dist/asymptote/graph3.asy b/Master/texmf-dist/asymptote/graph3.asy
index f690c6a3c10..f17b4e97074 100644
--- a/Master/texmf-dist/asymptote/graph3.asy
+++ b/Master/texmf-dist/asymptote/graph3.asy
@@ -2201,21 +2201,24 @@ picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b,
string name="", render render=defaultrender)
{
picture pic;
- real du=1/nu;
- real dv=1/nv;
+ real du=(b.x-a.x)/(nu-1);
+ real dv=(b.y-a.y)/(nv-1);
bool all=cond == null;
real scale;
if(maxlength > 0) {
real size(pair z) {
path3 g=vector(z);
- return abs(point(g,size(g)-1)-point(g,0));
+ triple w=point(g,size(g)-1)-point(g,0);
+ return max(w.x,w.y,w.z);
}
- real max=size((0,0));
+ real max=size(a);
for(int i=0; i <= nu; ++i) {
- real x=interp(a.x,b.x,i*du);
- for(int j=0; j <= nv; ++j)
- max=max(max,size((x,interp(a.y,b.y,j*dv))));
+ real u=a.x+i*du;
+ for(int j=0; j < nv; ++j) {
+ real v=a.y+j*dv;
+ max=max(max,size((u,v)));
+ }
}
scale=max > 0 ? maxlength/max : 1;
} else scale=1;
@@ -2224,9 +2227,10 @@ picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b,
if(group)
begingroup3(pic,name == "" ? "vectorfield" : name,render);
for(int i=0; i <= nu; ++i) {
- real x=interp(a.x,b.x,i*du);
+ real u=a.x+i*du;
for(int j=0; j <= nv; ++j) {
- pair z=(x,interp(a.y,b.y,j*dv));
+ real v=a.y+j*dv;
+ pair z=(u,v);
if(all || cond(z)) {
path3 g=scale3(scale)*vector(z);
string name="vector";