[pstricks] sin, cos and cutting area

Herbert Voss Herbert.Voss at fu-berlin.de
Fri Oct 26 14:15:55 CEST 2007


Michael Niedermair schrieb:
> Thanks for the two answers.
> 
> I use:
> 
> \psset{xunit=0.01cm,linewidth=0.5pt}
> \begin{pspicture}(-5,-2.5)(5,6)
> 
>     \pscustom[linestyle=none,fillstyle=solid,fillcolor=gray]{%
>        \psplot[plotpoints=200,algebraic=true]{45}{225}{x sin}
>        \psplot[plotpoints=200,algebraic=true]{45}{225}{x cos}
>     }

with algebraic it should be sin(x)

However, it is better (and easier) to draw a closed path.

Herbert

\documentclass{article}
\usepackage{pstricks,pst-plot}

\begin{document}
\psset{xunit=0.01cm,linewidth=0.5pt,plotpoints=200,plotstyle=curve}
\begin{pspicture}(-5,-2.5)(5,6)
    \pscustom[linestyle=none,fillstyle=solid,fillcolor=red!30]{%
       \psplot{0}{45}{x sin}
       \psplot{45}{0}{x cos} }
    \pscustom[linestyle=none,fillstyle=solid,fillcolor=green!30]{%
       \psplot{45}{225}{x sin}
       \psplot{225}{45}{x cos} }
    \pscustom[linestyle=none,fillstyle=solid,fillcolor=blue!30]{%
       \psplot{225}{360}{x sin}
       \psplot[liftpen=1]{360}{225}{x cos} }
    \psplot{0}{360}{x sin}
    \psplot{0}{360}{x cos}
    \psaxes[ticks=none,labels=none]{->}(0,0)(0,-1)(380,1.5)
    \psline[linecolor=blue](45,-1.5)(45,1.2)
    \psline[linecolor=blue](225,-1.5)(225,1.2)
    \psline[linecolor=blue](360,-1.5)(360,1.2)
\end{pspicture}

\end{document}




More information about the PSTricks mailing list