Hanh Nguyen Van Blog

Vẽ đồ thị của mặt tham số, đường tham số trong R^3

Posted by: hanhnguyenvan on: December 3, 2008

Chúng ta có thể dùng PSTrick để vẽ một số mặt hoặc đường trong không gian R^3. Kết quả thu được từ việc dùng gói này là rất nét và đẹp. Chúng ta có thể tải các gói cần thiết từ CTAN.

\documentclass[12pt,a4paper]{article}
\usepackage{pst-3dplot}
\usepackage{pst-grad}
\usepackage{pstricks-add,pst-plot,pstricks}
\usepackage{wrapfig,rotating}
\usepackage{tabularx}
\usepackage[tcvn]{vietnam}%
\begin{document}

\begin{pspicture}(-2,-2)(2,2)
\pstThreeDCoor[xMax=2,yMax=2,zMax=2]
\end{pspicture}

%

\begin{center}
%\bgroup
\makebox[\linewidth]{%
\def\radius{4 }\def\PhiI{20 }\def\PhiII{50 }
%
\def\RadIs{\radius \PhiI sin mul}
\def\RadIc{\radius \PhiI cos mul}
\def\RadIIs{\radius \PhiII sin mul}
\def\RadIIc{\radius \PhiII cos mul}
\begin{pspicture}(-4,-4)(4,5)
\psset{Alpha=45,Beta=30,linestyle=dashed}
\pstThreeDCoor[linestyle=solid,xMin=-5,xMax=5,yMax=5,zMax=5,IIIDticks]
\pstThreeDEllipse[linecolor=red](0,0,0)(0,\radius,0)(0,0,\radius)
\pstThreeDEllipse(\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
\pstThreeDEllipse(\RadIIs,0,0)(0,\RadIIc,0)(0,0,\RadIIc)
%
\pstThreeDEllipse[linestyle=dotted,SphericalCoor](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
\pstThreeDEllipse[SphericalCoor,
beginAngle=-90,endAngle=90](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
\pstThreeDEllipse[linestyle=dotted,SphericalCoor](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
\pstThreeDEllipse[SphericalCoor,
beginAngle=-90,endAngle=90](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
%
\psset{linecolor=blue,arrows=->,arrowscale=2,linewidth=1.5pt,linestyle=solid}
\pstThreeDEllipse[SphericalCoor,beginAngle=\PhiI,endAngle=\PhiII]%
(0,0,0)(\radius,90,\PhiII)(\radius,0,0)
\pstThreeDEllipse[beginAngle=\PhiII,endAngle=\PhiI](\RadIIs,0,0)(0,\RadIIc,0)(0,0,\RadIIc)
\pstThreeDEllipse[SphericalCoor,beginAngle=\PhiII,endAngle=\PhiI]%
(0,0,0)(\radius,90,\PhiI)(\radius,0,0)
\pstThreeDEllipse[beginAngle=\PhiI,endAngle=\PhiII](\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
\end{pspicture}
\begin{pspicture}(-4,-4)(4,5)
\psset{Alpha=45,Beta=30,linestyle=dashed}
\pstThreeDCoor[linestyle=solid,xMin=-5,xMax=5,yMax=5,zMax=5,IIIDticks]
\pstThreeDEllipse[linecolor=red](0,0,0)(0,\radius,0)(0,0,\radius)
\pstThreeDEllipse(\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
\pstThreeDEllipse(\RadIIs,0,0)(0,\RadIIc,0)(0,0,\RadIIc)
%
\pstThreeDEllipse[linestyle=dotted,SphericalCoor](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
\pstThreeDEllipse[SphericalCoor,
beginAngle=-90,endAngle=90](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
\pstThreeDEllipse[linestyle=dotted,SphericalCoor](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
\pstThreeDEllipse[SphericalCoor,
beginAngle=-90,endAngle=90](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
%
\pscustom[fillstyle=solid,fillcolor=blue]{
\pstThreeDEllipse[SphericalCoor,beginAngle=\PhiI,endAngle=\PhiII]%
(0,0,0)(\radius,90,\PhiII)(\radius,0,0)
\pstThreeDEllipse[beginAngle=\PhiII,endAngle=\PhiI](\RadIIs,0,0)(0,\RadIIc,0)(0,0,\RadIIc)
\pstThreeDEllipse[SphericalCoor,beginAngle=\PhiII,endAngle=\PhiI]%
(0,0,0)(\radius,90,\PhiI)(\radius,0,0)
\pstThreeDEllipse[beginAngle=\PhiI,endAngle=\PhiII](\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
}
\end{pspicture}
}
%\egroup
\end{center}

\psframebox{%
\begin{pspicture}(-3.5,-2)(3,6)
\pstThreeDCoor[zMax=6]
\pstIIIDCylinder{2}{5}
\end{pspicture}
}

\psframebox{%
\begin{pspicture}(-3.5,-2)(3,6.75)
\pstThreeDCoor[zMax=7]
\pstIIIDCylinder[RotY=30,fillstyle=solid,
fillcolor=red!20,linecolor=black!60](0,0,0){2}{5}
\end{pspicture}
}

\begin{pspicture}(-6,-4)(6,5)
\psset{Beta=15}
\pstThreeDCoor[xMin=-1,xMax=5,yMin=-1,yMax=5,zMin=-1,zMax=5]
\psplotThreeD[
algebraic,
plotstyle=curve,
yPlotpoints=50,xPlotpoints=50,
linewidth=0.5pt]
(-4,4)(-4,4){10*(x^3+x*y^4-x/5)*Euler^(-x^2-y^2)
+Euler^(-((x-1.225)^2+y^2))}
\end{pspicture}

\begin{pspicture}(-3.25,-2.25)(3.25,5.25)
\pstThreeDCoor[zMax=5]
\parametricplotThreeD[xPlotpoints=200,
linecolor=blue,%
linewidth=1.5pt,plotstyle=curve,
algebraic](0,18.86){% radiant
2.5*cos(t) | 2.5*sin(t) | t/5.24}
\end{pspicture}

\begin{pspicture}(-6,-4)(6,5)
\psset{Beta=15}
\pstThreeDCoor[xMin=-1,xMax=5,yMin=-1,yMax=5,zMin=-1,zMax=5]
\psplotThreeD[
algebraic,
plotstyle=curve,
yPlotpoints=50,xPlotpoints=50,
linewidth=0.5pt]
(-1.3,1.3)(-1.3,1.3){x^4+y^4-x^2-y^2-2*x*y}
\end{pspicture}

\begin{wrapfigure}[19]{r}[-6cm]{10mm}
\begin{pspicture}(-3,-3)(5.5,5)
\psset{algebraic,plotpoints=600}
\psline{->}(-3,0)(4.6,0)\rput(4.6,-0.2){$x$}
\psline{->}(0,-4.5)(0,5)\rput(0.2,5){$y$}
\psline(1,-4.5)(1,5)
\psplot{-2.4}{4.6}{x}
\pcline[linestyle=none](0,0.25)(1,1.25)\lput{:U}{$y=x$}
\pcline[linestyle=none](0.8,-4.5)(0.8,3)\lput{:U}{$x=1$}
\psplot{-2}{2.2}{(x+1)^2*(2-x)}
\psplot{-2}{0.6}{(x^2-x+2)/(x-1)}
\psplot{1.6}{4}{(x^2-x+2)/(x-1)}
\rput(0.2,-0.2){$O$}
\rput(-1,-0.2){$A$}
\rput(1.2,4.2){$B$}
\rput(2.45,3.5){$y=\frac{x^2-x+2}{x-1}$}
\rput{90}(-1,1.8){$y=(x+1)^2(2-x)$}
\end{pspicture}
\end{wrapfigure}

§å thÞ hµm sè ®­îc x¸c ®Þnh nh­ sau:

\begin{wrapfigure}[10]{c}[-6cm]{10mm}
\begin{pspicture}(-2,-3)(4.5,3)
\psset{algebraic,plotpoints=600}
\psline{->}(-2,0)(4.5,0)\rput(4.3,-0.2){$x$}
\psline{->}(0,-3)(0,3)\rput(0.2,2.8){$y$}
\rput(-0.2,-0.2){$O$}
\rput(3,1){$x-2y=2$}
\rput(-0.7,2.5){$x+y=1$}
\psplot{-2}{4}{0.5*x-1}
\psplot{-1.8}{3.8}{1-x}
\pscustom[linestyle= none,fillstyle=eofill, fillstyle=vlines]{
\psplot{-2}{4}{0.5*x-1}
\psline(4,1)(4,-3)
\psline(4,-3)(-2,-3)
\psline(-2,-3)(-2,-2)
}
\pscustom[linestyle= none,fillstyle=eofill, fillstyle=hlines]{
%\psplot{-2}{4}{1-x}
\psline(4,-3)(-2,3)
\psline(4,-3)(-2,-3)
\psline(-2,-3)(-2, 3)
}
\end{pspicture}
\end{wrapfigure}

\end{document}

Leave a Reply

Blog Stats

  • 3,076 Visitors

 

December 2008
M T W T F S S
« Oct   Mar »
1234567
891011121314
15161718192021
22232425262728
293031  

Categories

Recent Comments

RSS vietnamnet news

  • An error has occurred; the feed is probably down. Try again later.