summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pstricks_calcnotes/Convert_PstricksCode_To_Pdf/convert.tex
blob: d7464faaf3217c22c7d9781fcc04484fef1672f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\documentclass[11pt,a4paper,oneside]{article}
\usepackage{pdftricks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\xch{\catcode`\p=12 \catcode`\t=12}\def\ych{\catcode`\p=11 \catcode`\t=11}
\xch \def\dec#1pt{#1}\ych \def\decimal#1{\expandafter\dec \the#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\vecfldnew#1#2#3#4#5#6#7#8{%
\newcount\intg \newdimen\fx \newdimen\fy  \newdimen\slope \newdimen\interm
\def\fintg{\interm=#8 \interm=\intg\interm \ifdim\ifdim\slope<0pt-\fi\slope>\interm\advance\intg by 1\fintg\fi}
\multido{#2}{#4}
{\multido{#1}{#3}
{\curvepnodes[algebraic,plotpoints=2]{0}{1}{\nx+((#5)*t)*(1/sqrt(1+(#6)^2))|\ny+((#5)*t)*(1/sqrt(1+(#6)^2))*(#6)}{P}
#7 \slope=10\slope\fintg
\ifnum\intg>10\psline[linecolor=red]{->}(P0)(P1)\else\ifnum\intg=0\psline[linecolor=red!5]{->}(P0)(P1)\else\multiply\intg by 10
\psline[linecolor=red!\the\intg]{->}(P0)(P1)\fi\fi
\intg=0\slope=0pt
}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Making files \texttt{.ps} from \texttt{PSTricks}}
\begin{document}
\maketitle
\begin{psinputs}
\usepackage{pstricks}
\usepackage[dvips]{geometry}
\usepackage{pst-plot,pst-coil,multido,pst-xkey,pst-node}
\usepackage{calculator}
\usepackage{calculus}
\usepackage{pst-func}
\usepackage{pstricks-add}
\end{psinputs}
\section{Here is the PSTricks code to be converted}
\begin{pdfpic}
\begin{pspicture}(-3,-3)(3,3)
\psset{unit=28.5pt,dotsize=2.6pt}
\vecfldnew{\nx=-3.00+0.3}{\ny=-3.00+0.3}{20}{20}{0.3}{2*(\nx)*(\ny)/(1+(\ny)^2)}
{\fx=\nx pt\SUMfunction{\ONEfunction}{\SQUAREfunction}{\Fncty}
\Fncty{\ny}{\soly}{\Dsoly}\DIVIDE{\Dsoly}{\soly}{\tempa}\slope=\tempa pt\slope=\decimal\fx\slope}{3pt}
\psaxes[labelFontSize=$\footnotesize$,Dy=1,Dx=1,ticksize=2.2pt,labelsep=4pt,linewidth=0.7pt]{->}(0,0)(-3,-3)(3,3)
\end{pspicture}
\end{pdfpic}
\end{document}