[pstricks] pstricks and metapost 2d 3d

Ruben Agapito rubtiger14 at yahoo.com
Mon Aug 8 09:59:13 CEST 2005


If you want to do simple graphics in tex, 2d and parametric functions, you may use jpicedt 1.4 (do a google search). The advantage of this is the use of several tools to embellish your picture, put LaTeX code in any part of the figure, and if you know PsTricks you can tweak the output. Then, after you're done, you can export your graphic as a LaTeX file with PsTricks code embedded. A really nice feature.
  For fancy graphs, you may use Maxima (or Mathematica, Matlab, Scilab, Mupad... any software that export graphics in eps format) and (if you want widgets... a really cool add-on), you can also install wxMaxima, then run the program using the latter one. Maxima is free and looks like Matlab, the output can be exported as EPS file. Then you can add LaTeX code over the picture using PsTricks. Take a look at the example contained in the Zip file. Very rough, I did it in a couple of minutes.
 
Best,
Ruben Agapito.

Sebastiano Spatola <sebastianospatola at virgilio.it> wrote:
Dear Group Pstricks,
my name is Sebastiano Spatola and I am a doctor in Mathematica and physics for students of high school. I worked 
I use from more of a Latex year and I have discovered from little days the metapost of 2D and 3D. However to create a figure with labels, headings I 
I must insert any codes in a source .tex 
\listfiles
\documentclass[a4paper]{article}%  Herbert Voss 2004-10-06
\usepackage{pstricks}
\usepackage{pstricks-add}
\usepackage{multido}
\def\func{%
    const0 x sin dup mul 3 mul div neg /p exch def
    p abs sqrt neg /r exch def
    const1 2.0 div neg /q exch def
    p 0 lt {
      p dup mul p mul q dup mul add 0 le {
        q r 3 exp div arccos 
        3 div cos r dup add neg mul
      }{
        q r 3 exp div arch
        3 div cosh r dup add neg mul
      } ifelse
    }{
      q r 3 exp div arsh
      3 div sinh r dup add neg mul      
    } ifelse
}
\begin{document}
\textbf{Dynamical flow around a cylinder}
\[
\left(r^2-\frac{c_1}{r}\right)\sin^2\theta=c_0
\]
 
which is the same as
 
\[
r^3-\frac{c_0}{\sin^2\theta}\cdot r-c_1=0
\]
 
which can be solved by the formula of Cardano:
 
\[
r^3+3pr+2q=0
\]
 
\bigskip
\begin{pspicture*}(-5,-2.5)(5,2.5)
  \pstVerb{
    /e 2.718281828459045 def
    /arccos { dup dup mul neg 1.0 add sqrt exch atan } def
    /sinh { dup e exch exp exch neg e exch exp sub 2 div } def
    /cosh { dup e exch exp exch neg e exch exp add 2 div } def
    /arsh { dup dup mul 1 add sqrt add ln } def
    /arch { dup dup mul 1 sub sqrt add ln } def
  }
  \psaxes(0,0)(-5,-2.5)(5,2.5)
  \pscircle[linecolor=red]{1}
  \psset{plotpoints=100,linewidth=0.05pt,polarplot=true,linecolor=blue}
  \multido{\rA=0.005+0.05}{5}{
    \psplot{1}{179}{%
      /const0 \rA\space def 
      /const1 1.0 def % cylinder radius
      \func
    }
    \psplot{181}{359}{%
      /const0 \rA\space def 
      /const1 1.0 def % cylinder radius
      \func
    }%
  }
  \multido{\rA=0.03+0.25}{20}{
    \psplot{1}{179}{%
      /const0 \rA\space def 
      /const1 1.0 def % cylinder radius
      \func
    }
    \psplot{181}{359}{%
      /const0 \rA\space def 
      /const1 1.0 def % cylinder radius
      \func
    }%
  }
\end{pspicture*}
 
\end{document}

 
 

But doesn't exist a program that creates me the inverse Polish notation, interval, etc? How long want to understand first and then to write the codes of a figure?
Not understand nothing when I must to draw a function in 2D and 3D. For example; if  I must to draw the function x*\sqrt(x^2+y^2-1) or the area of the trapezoid of the function x +sin x in the interval [\pi/2  3/4 \pi] as I have to do?  Want years to understand as create only a simple figure; represent of behaviour a give a complex figure. But doesn't exist a program that creates me directly the code that transforms me a function in the inverse Polish notation and that to draw it?
I hope you sent me a answer of my problem.
Best regards 
Sebastiano Spatola

_______________________________________________
pstricks mailing list
pstricks at tug.org
http://tug.org/mailman/listinfo/pstricks



		
---------------------------------
 Start your day with Yahoo! - make it your home page 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20050808/ecb96f92/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.zip
Type: application/x-zip-compressed
Size: 51388 bytes
Desc: 3499968288-example.zip
Url : http://tug.org/pipermail/pstricks/attachments/20050808/ecb96f92/attachment.bin 


More information about the PSTricks mailing list