%% $Id: pst-ellipsoid-doc-exa14.tex 1284 2026-06-08 05:56:52Z herbert $
\begin{externalDocument}[
  compiler=lualatex, runs=1, crop, cleanup,
  %xindex, xindexOptions={-l DE --config AU},
  %mpwidth=0.6\linewidth, 
  %force,
  usefancyvrb=false,
  docType=latex,
]{voss}
\DocumentMetadata{}
\documentclass{article}
\pagestyle{empty}
\usepackage{libertinus}
%StartVisiblePreamble
\usepackage[dvipsnames,svgnames]{pstricks}
\usepackage{pst-solides3d}
%StopVisiblePreamble
\begin{document}
\definecolor{coquille}{rgb}{0.984 0.95 0.718}
\begin{pspicture}(-3.5,-4)(3.5,4)
\psset{viewpoint=100 120 30 rtp2xyz,Decran=200,lightsrc=viewpoint,solidmemory,a=3,b=2,c=1}
\codejps{
  /ngrid  [36 18] def
  /base [0 360 -90 90] def
  ellipsoid
  /xO1 a a dup mul b dup mul sub  a dup mul c dup mul sub div sqrt mul def
  /zO1 c b dup mul c dup mul sub  a dup mul c dup mul sub div sqrt mul def
  /yO1 0 def
  % distance de O à O1
  /dO xO1 dup mul zO1 dup mul add sqrt def
  /CosT b dup mul c dup mul sub a dup mul c dup mul sub div sqrt b div a mul def
  /SinT a dup mul b dup mul sub a dup mul c dup mul sub div sqrt b div c mul def
  % distance de O à O1
  % les coordonnées d'un point du plan de coupe
  /xP 0.5 xO1 mul def
  /zP xP zO1 mul xO1 div def
  % la normale au plan de coupe circulaire
  /nX {SinT 0 CosT} def
  % distance au plan de coupe
  /dP xP SinT mul zP CosT mul add abs def
  /radiusCylindre b 1 b dP mul a c mul div dup mul sub sqrt mul def
[ nX dP ]
solidplansepare
/ellipsoide2 exch def
/ellipsoide1 exch def
ellipsoide1
/xP 0.2 xO1 mul def
/zP xP zO1 mul xO1 div def
/dP xP SinT mul zP CosT mul add abs def
[ nX dP ]
solidplansepare
/ellipsoide2 exch def
/ellipsoide1 exch def
ellipsoide2
dup (yellow) outputcolors
%dup [0.1 0.2] solidputhuecolors
solidlightOn
drawsolid**
0.1 setlinewidth
ellipsoid
drawsolid
}
\axesIIID(3,2,1)(4,3,2)
\end{pspicture}
\end{document}
\end{externalDocument}