我知道有些标签不对应,但我想提请你注意这个问题。我制作了两个图形渐近线.ualberta.ca/,但我想将它们下载为 pdf 文件,但它会一直无限加载,如果我尝试将其下载为 png,则不会发生这种情况。 其他人有这个问题吗?还是可能是我的机器出了问题? 如果问题出在我的代码中,有什么方法可以解决这个问题?
第一的:
settings.render=8;
import graph3;
import palette;
currentprojection=orthographic(1,1,0.3);
//currentlight.background = gray(0.7);
typedef triple newtriple(pair);
// https://en.wikipedia.org/wiki/Hyperboloid
newtriple f(real a, real b, real c)
{
return new triple(pair k){
real u=k.x,v=k.y;
real x,y,z;
x=a*cosh(v)*cos(u);
y=b*cosh(v)*sin(u);
z=c*sinh(v);
return (x,y,z);
};
}
triple F(pair z){ return f(1,1,1)(z); }
// Gauss map
triple g(pair z)
{
real u=z.x, v=z.y;
triple U=(-cosh(v)*sin(u),cosh(v)*cos(u),0);
triple V=(sinh(v)*cos(u),sinh(v)*sin(u),cosh(v));
return 1.5*cross(U,V)/abs(cross(U,V));
}
// https://trecs.se/hyperboloidOfOneSheet.php
path3 vector(pair z) {
real u=z.x, v=z.y;
real a=1, b=1, c=1;
real x,y,z;
x=-b*c*cosh(v)^2*cos(u);
y=-a*c*cosh(v)^2*sin(u);
z=a*b*sinh(v)*cosh(v);
return O--(-(x,y,z)/sqrt(x^2+y^2+z^2));
}
size(13cm);
surface sf=surface(F,(0,-1.5),(2pi,1.5),40,Spline);
//sf.colors(palette(sf.map(zpart),Rainbow()));
draw(sf,RGB(0,153,216),render(merge=true));
label("$(\mathcal{H})$",(-1,2.2,2.7),dir(45));
add(vectorfield(vector,F,(0,-1.5),(2pi,1.5),10,0.5,red,render(merge=true)));
xaxis3(Label("$x$",EndPoint),0,3.5,Arrow3);
yaxis3(Label("$y$",EndPoint),0,3.5,Arrow3);
zaxis3(Label("$z$",EndPoint),0,3,Arrow3);
pair z=(pi/3,1);
dot("$P$",F(z),dir(-10),white+3bp);
draw(Label("$N(P)$",EndPoint,LeftSide),shift(F(z))*vector(z),white,Arrow3);
transform3 t=shift(5*(Y-X));
surface sg=surface(g,(0,-1.5),(2pi,1.5),20,Spline);
//sg.colors(palette(sg.map(zpart),Rainbow()));
draw(t*sg,RGB(231,76,60),render(merge=true));
label("$N\left(\mathcal{H} \right)$",t*(-.5,0.5,1.2),dir(45));
dot(t*(0,0,1.5/sqrt(2)),white+3bp);
draw(Label("$x$",EndPoint),t*((0,0,0)--(3.5,0,0)),Arrow3);
draw(Label("$y$",EndPoint),t*((0,0,0)--(0,3.5,0)),Arrow3);
draw(Label("$z$",EndPoint),t*((0,0,0)--(0,0,3)),Arrow3);
draw(Label("$N$",Relative(.5),N),subpath((0,0,0)--t*(0,0,0),0.4,0.6),Arrow3);
label("$\frac{1}{\sqrt{2}}$",t*(0.9,0,1.4),dir(45));
第二:
settings.render=8;
import graph3;
import palette;
currentprojection=orthographic(1,1,0.3);
//currentlight.background = gray(0.7);
typedef triple newtriple(pair);
// https://en.wikipedia.org/wiki/Hyperboloid
newtriple f(real a, real b, real c)
{
return new triple(pair k){
real u=k.x,v=k.y;
real x,y,z;
x=-a*u;
y=b*v;
z=c*exp(u)*sin(v);
return (x,y,z);
};
}
triple F(pair z){ return f(1,1,1)(z); }
// Gauss map
triple g(pair z)
{
real u=z.x, v=z.y;
real x,y,z;
x=exp(u)*sin(v);
y=exp(u)*cos(v);
z=sqrt(1+exp(2*u));
return -7*(x,y,-1)/z;
}
// https://trecs.se/hyperboloidOfOneSheet.php
path3 vector(pair z) {
real u=z.x, v=z.y;
real a=1, b=1, c=1;
real x,y,z;
x=-b*c*exp(u)*sin(v);
y=-a*c*exp(u)*cos(v);
z=a*b*sqrt(1+exp(2*u));
return O--(-(x,y,-1)/z);
}
size(480,400,false);
surface sf=surface(F,(-10,-12),(3,6),40,Spline);
//sf.colors(palette(sf.map(zpart),Rainbow()));
draw(sf,RGB(0,153,216),render(merge=true));
add(vectorfield(vector,F,(-10,-12),(3,6),10,2.5,red,render(merge=true)));
//xaxis3(Label("$x$",BeginPoint),0,7,Arrow3);
draw(Label("$x$",EndPoint),(12,0,0)--(-12,0,0),Arrow3);
yaxis3(Label("$y$",EndPoint),0,12,Arrow3);
zaxis3(Label("$z$",EndPoint),-18,22,Arrow3);
label("$\mathcal{H}$",(-.5,5.5,18),dir(45));
transform3 t=shift(20*(Y-X));
surface sg=surface(g,(-2.7,-12),(3,6),20,Spline);
//sg.colors(palette(sg.map(zpart),Rainbow()));
draw(t*sg,RGB(231, 76, 60),render(merge=true));
label("$N\left(\mathcal{H} \right)$",t*(-.5,6,6),dir(45));
draw(Label("$x$",EndPoint),t*((0,0,0)--(12,0,0)),Arrow3);
draw(Label("$y$",EndPoint),t*((0,0,0)--(0,12,0)),Arrow3);
draw(Label("$z$",EndPoint),t*((0,0,0)--(0,0,13)),Arrow3);
//dot(Label("$(0,0,1)$",black),t*(0,0,7),dir(135),white+5bp);
label("$(0,0,1)$",t*(.5,0,7),dir(135));
draw(Label("$N$",Relative(.5),N),subpath((0,0,0)--t*(0,0,0),0.4,0.6),Arrow3);
答案1
我刚刚将 asymptote.ualberta.ca 更新到最新开发版本(即将发布为 Asymptote 2.71)并确认您的第一个示例运行良好。