[pstricks] tangent lines and positioning within pst-solides3d

Jose Agapito jarpepe04 at yahoo.com
Thu Jul 2 18:13:37 CEST 2009


Hi folks,

I've been trying out the package pst-solides3d to create a visual interpretation of the directional derivative. Here is the code:


\documentclass{article} % geometric interpretation of directional derivative. 
%Draft written by José Agapito Ruiz

\usepackage{pstricks}%
\usepackage{pst-solides3d}
\usepackage{pst-3dplot}%

\thispagestyle{empty}

\begin{document}

\psset{viewpoint=50 40 30 rtp2xyz,Decran=50}%
\psset{lightsrc=viewpoint,linewidth=0.5\pslinewidth}%

\begin{pspicture}(-6,-4)(7,12)
%\psgrid
\psSolid[object=grille,name=baseplane,base=-4 4 -4 4,action=draw,linecolor=lightgray]%
\psSurface[%
   fillcolor=cyan!50,
%   tracelignedeniveau=true,
%   hauteurlignedeniveau=5,
%   linewidthlignedeniveau=3,
%   couleurlignedeniveau=blue,
     intersectionplan={[2 -1 0 -3]},
     intersectioncolor=(rouge),
     intersectionlinewidth=1.5,
     intersectiontype=0,
     ngrid=.15 .15,incolor=yellow,algebraic,
   axesboxed,Zmin=0,Zmax=10](-4,-4)(4,4){%
   (-(x-3)^2-2*(y-1)^2+90)/10 }%

%%% lines passing through the points at the domain and at the surface
%
\psSolid[object=line,args=-0.5 -4 0 4.25 5.5 0,linewidth=1.5pt,linestyle=dashed,linecolor=blue]% line in the direction of (1,2,0) on XY plane
\psSolid[object=line,args=-0.5 -4 8.775 4.25 5.5 8.775,linewidth=1.5pt,linestyle=dashed,linecolor=blue]% line parallel to the above one on plane z=8.775
\pstThreeDPut(-1.95,-0.525,7.97){\psSolid[object=line,args=-0.5 -4 0.1 3.5 4 -0.9,linewidth=1.5pt,linecolor=black]}% tangent line to the surface at (2.5,2,8.775)
%%%


%%% vector
%
\psSolid[object=vecteur,definition=vecteur3d, args=2 1 0 2.5 2 0,linecolor=blue,
linewidth=2pt](2.5,2,0)% vector (1,2,0)
%%%


%%% points at the surface and at the domain
%
\psSolid[object=point,args=2.5 2 8.775,dotsize=1pt 1,linecolor=blue]% point at the surface
\psSolid[object=point,args=2.5 2 0,dotsize=1pt 1,linecolor=blue]% point at the domain
%%%


%%% transparent plane perpendicular to XY plane and in the direction of vector %(1,2,0)
%
\psSolid[fillcolor=white!40,opacity=0.2,object=plan,
    definition=equation,args={[2 -1 0 -3]}, base=-5.3 7.4 -4 7.5](-3.6,-4.5,0)%
%%%

\end{pspicture}

\end{document}

===============================

I came out with the following questions.

1. The command \psSurface has the option of drawing the curve that results of intersecting a defined surface with a plane. Is it possible to label such a curve for further use later on?

2. Is there a direct way to plot the tangent line to the curve that results of intersecting a defined surface with a plane? I did this manually combining the command \pstThreeDPut of the pst-3dplot package with the command \psSolid and then 
figuring out the coordinates by trial and error. Another way I can think of is to figure out the coordinates of such a tangent line by simple inspection by using \psgrid and then to use the  \psline command. But there must be certainly a most efficient way of doing this.

3. How do we translate a line object? I tried for instance 

\psSolid[object=line,args=-0.5 -4 8.775 4.25 5.5 8.775,linewidth=1.5pt,linestyle=dashed,linecolor=blue](a,b,c) to place the line at the point (a,b,c) but it didn't work. However, it did work with object=plan.

4. Following the previous question, what is the center of an object=plan? I translate such an object to a point (a,b,c) but I did it more or less by trial and error.

5. Finally, I tried to use linestyle=none as an option in the \psSolid command for the object=plan, but it did not work.

Thank you for your time.

Best regards,

José Agapito.



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20090702/ada2ca17/attachment.html>


More information about the PSTricks mailing list