[pstricks] Slices of a solid of revolution
Juergen Gilg
gilg at acrotex.net
Wed Jun 13 17:09:42 CEST 2007
... what about using
\parametricplotThreeD
and paramterize the "volume curves"
Juergen
Herbert Voss wrote:
> Hamed wrote:
>
>> Hi everybody,
>>
>> First of all, thanks a lot for Juergen,
>>
>> Second, my question was about the slice of a solid of revolution.
>>
>> I meant can we do the slice for the solid obtained by rotating the region
>> bounded by y=x and y=x^2 about the x-axis
>>
>>
> hope, this helps
>
> Herbert
>
> \documentclass{article}
> \usepackage{pst-plot}
> \SpecialCoor
> \usepackage{multido}
> \parindent=0pt
>
> #1: x1; #2: x2: #3: no of steps; #4: equation
> \def\psVolume(#1,#2)#3#4{{%
> \psplot{#1}{#2}{#4}\psplot{#1}{#2}{#4 neg}
> \multido{\iA=1+1}{#3}{%
> \pscustom[fillcolor=green,fillstyle=solid]{%
> \code{
> /dX #2 #1 sub #3 div def
> /Start dX \iA\space 1 sub mul #1 add def
> /End Start dX add def
> /Height End Start add 2 div /x ED #4 def }
> \psellipticarc(!Start 0)(! Height 8 div Height){90}{270}
> \rlineto(! dX 0)
> \psellipticarc(!End 0)(! Height 8 div Height){270}{90}
> \rlineto(!dX neg 0)}}
> \psellipticarc(#2,0)(! #2 dup #1 sub #3 div 2 div sub
> /x ED x 4 div #4){90}{270}
>
> \psset{plotstyle=line,linestyle=dashed,plotpoints=40,dotstyle=*,dotsize=0.5pt}
> \psplot{#1}{#2}{#4}\psplot{#1}{#2}{#4 neg}%
> }\ignorespaces}
>
> \begin{document}
>
> \psset{xunit=2}
> \begin{pspicture}(-0.5,-4)(4,4)
> \psaxes{->}(0,0)(0,-4)(3,4)
> \psVolume(0,1){2}{x}
> \psVolume(1,2){2}{x dup mul}
> \psline(2,0)(3,0)
> \end{pspicture}
>
> \begin{pspicture}(-0.5,-4)(4,4)
> \psaxes{->}(0,0)(0,-4)(3,4)
> \psVolume(0,1){20}{x}
> \psVolume(1,2){20}{x dup mul}
> \psline(2,0)(3,0)
> \end{pspicture}
>
> \end{document}
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
>
>
--
jürgen gilg
austr. 59
70376 stuttgart
tel 0711-59 27 88
e-mail gilg at acrotex.net
webpage www.acrotex.net
www.gilligan-online.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20070613/cb058100/attachment.html
More information about the PSTricks
mailing list