Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (%11) hc:2*x*y+2*x*z=2;
- (%i2) draw3d(enhanced3d=true,implicit(hc,x,-5,5,y,-5,5,z,-5,5));
- % impsurf.tex :
- %
- documentclass[10pt,a4paper]{article}
- usepackage{lmodern}
- usepackage{subcaption}
- usepackage[inline]{asymptote}
- usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
- begin{asydef}
- settings.outformat="png";
- settings.render=8;
- import graph3;
- import contour3;
- currentlight=light(gray(0.8),ambient=gray(0.1),specular=gray(0.7),
- specularfactor=3,viewport=true,dir(42,48));
- pen bpen=rgb(0.75, 0.7, 0.1);
- material m=material(diffusepen=0.7bpen
- ,ambientpen=bpen,emissivepen=0.3*bpen,specularpen=0.999white,shininess=1.0);
- end{asydef}
- %
- begin{document}
- %
- begin{figure}
- captionsetup[subfigure]{justification=centering}
- centering
- begin{subfigure}{0.49textwidth}
- begin{asy}
- size(200,0);
- currentprojection=orthographic(camera=(9,10,4),up=Z,target=O,zoom=1);
- // ellipsoid
- real f(real x, real y, real z) {return (x^2)/(2^2) + (y^2)/(3^2) + (z^2)/(2^2)-1;}
- draw(surface(contour3(f,(-3,-3,-3),(3,3,3),32)),m
- ,render(compression=Low,merge=true));
- xaxis3(Label("$x$",1),-4,4,red);
- yaxis3(Label("$y$",1),-4,4,red);
- zaxis3(Label("$z$",1),-4,4,red);
- end{asy}
- %
- caption{$(frac{x}{2})^2+(frac{y}{3})^2+(frac{z}{2})^2= 1$ (ellipsoid)}
- label{fig:1a}
- end{subfigure}
- %
- begin{subfigure}{0.49textwidth}
- begin{asy}
- size(200,0);
- currentprojection=orthographic(camera=(9,4,4),up=Z,target=O,zoom=1);
- // hyperbolic cylinder
- real f(real x, real y, real z) {return 2*x*y + 2*x*z-1;}
- draw(surface(contour3(f,(-3,-3,-3),(3,3,3),32)),m
- ,render(compression=Low,merge=true));
- xaxis3(Label("$x$",1),-4,4,red);
- yaxis3(Label("$y$",1),-4,4,red);
- zaxis3(Label("$z$",1),-4,4,red);
- end{asy}
- %
- caption{$2xy + 2xz = 1$ (hyperbolic cylinder)}
- label{fig:1b}
- end{subfigure}
- caption{}
- label{fig:1}
- end{figure}
- %
- end{document}
- %
- % Process:
- %
- % pdflatex impsurf.tex
- % asy impsurf-*.asy
- % pdflatex impsurf.tex
- documentclass[pstricks]{standalone}
- usepackage{pst-solides3d,pst-math}
- begin{document}
- begin{pspicture}(-4,-4)(4,4)% the main 2D area
- psset{lightsrc=viewpoint,viewpoint=50 -200 20 rtp2xyz,Decran=30}
- pstVerb{/constA 1 def /constB 1 def }
- defFunction[algebraic]{hcyl0}(u,v)
- { constA*SINH(u) }% x=f(u)
- { constB*COSH(u) }% y=f(u)
- { v } % z=f(v)
- defFunction[algebraic]{hcyl1}(u,v)
- { constA*SINH(u) }% x=f(u)
- { -constB*COSH(u) }% y=f(u)
- { v } % z=f(v)
- psSolid[object=surfaceparametree,base=-2 2 -3 3,
- fillcolor=red!40,function=hcyl0,linewidth=0.1pslinewidth,ngrid=25]
- psSolid[object=surfaceparametree,base=-2 2 -3 3,
- fillcolor=red!40,function=hcyl1,linewidth=0.1pslinewidth,ngrid=25]
- gridIIID[Zmin=-3,Zmax=3](-4,4)(-4,4)
- end{pspicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement