Retour

c01.tex

Télécharger le fichier Fichier PDF
Image PNG
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{pstricks-add,pst-solides3d}
\renewcommand{\sfdefault}{phv}
 
\makeatletter
\newdimen\pssizeStar
\def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}}
\psset@sizeStar{1.5pt}
 
%% adapté de \psRandom du package pstricks-add
%% pour rendre aléatoire la taille des étoiles
\def\psRandomStar{\pst@object{psRandomStar}}%
\def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}}
\def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}}
\def\psRandomStar@iii(#1)(#2)#3{%
  \def\pst@tempA{#3}%
  \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi
  \pst@getcoor{#1}\pst@tempA
  \pst@getcoor{#2}\pst@tempB
  \begin@SpecialObj
  \addto@pscode{
    \pst@tempA\space /yMin exch def
    /xMin exch def
    \pst@tempB\space /yMax exch def
    /xMax exch def
    /dy yMax yMin sub def
    /dx xMax xMin sub def
    rrand srand                 % initializes the random generator
    /getRandReal { rand 2147483647 div } def
     \psk@randomPoints {
    /DS \pst@number\pssizeStar\space getRandReal mul def
    \@nameuse{psds@\psk@dotstyle}
     \ifPst@color getRandReal 1 1 sethsbcolor \fi
     getRandReal dx mul xMin add
     getRandReal dy mul yMin add
     Dot
     \ifx\psk@fillstyle\psfs@solid fill \fi stroke
    } repeat
  }%
  \end@SpecialObj
  \endpsclip
  \ignorespaces
}
\makeatother
 
 
\pagestyle{empty}
\begin{document}
\psset{path=../data}
 
%@AUTEUR: Manuel Luque
 
\psset{SphericalCoor,viewpoint= 20 10 30,Decran=30}
\begin{pspicture}(-6,-3)(6,3)
\psframe(-6,-3)(6,3)
\pstVerb{/i 0 store
  /rougepale {1 0.5 0.5 setrgbcolor} def
  /vertpale {0.5 1 0.5 setrgbcolor} def
  /jaunepale {1 1 0.5 setrgbcolor} def}%
\defFunction[algebraic]{cour}(u,v){u}{v}{sin(u^2+v^2)}
\psSolid[object=surfaceparametree,
         function=cour,
         base=-2 2 -2 2,
         fcol=333 {i (rougepale) i 1 add (vertpale) i 2 add (jaunepale) /i i 3 add store} repeat,
         incolor=yellow!50,
         ngrid=50 20]
\end{pspicture}
 
\end{document}