diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pstricks-examples-en/14-05-1.ltx')
-rw-r--r-- | Master/texmf-dist/doc/latex/pstricks-examples-en/14-05-1.ltx | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pstricks-examples-en/14-05-1.ltx b/Master/texmf-dist/doc/latex/pstricks-examples-en/14-05-1.ltx new file mode 100644 index 00000000000..cde803ac279 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pstricks-examples-en/14-05-1.ltx @@ -0,0 +1,92 @@ +%% +%% A DANTE-Edition example +%% +%% Example 14-05-1 on page 164. +%% +%% Copyright (C) 2011 Herbert Voss +%% +%% It may be distributed and/or modified under the conditions +%% of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% +%% See http://www.latex-project.org/lppl.txt for details. +%% +%% +%% ==== +% Show page(s) 1 +%% +\documentclass[]{article} +\pagestyle{empty} +\setlength\textwidth{415.41023pt} +\setlength\parindent{0pt} + +\usepackage{pst-node,multido,pst-xkey} +\SpecialCoor +\makeatletter +\define@boolkey[psset]{}[Pst@]{showFP}[true]{}% mark focal point? +\psset{showFP=true} % default +\def\focalPoint{\pst@object{focalPoint}} +\def\focalPoint@i(#1)(#2)(#3)#4{{ % keep everything local + \use@par% % set parameters + \pst@getcoor{#1}\pst@tempA% point A % get coordinates as x y + \pst@getcoor{#2}\pst@tempB% point B % + \pst@getcoor{#3}\pst@tempC% point C % + \pnode(! % set nodes + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def % x y in user coordinates + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + \pst@tempC /YC exch \pst@number\psyunit div def + /XC exch \pst@number\psxunit div def + XA XB XC add add 3.0 div % xSP + YA YB YC add add 3.0 div % ySP + ){#4}% % #5 = node name + \ifPst@showFP\qdisk(#4){2pt}\fi}% + \ignorespaces} % mark? +\makeatother + +\begin{document} +\psset{unit=0.7} +\begin{pspicture}(-5,-5)(5,5) + \multido{\rA=-5+0.5,\rB=0+0.5,\rC=5+-0.5}{10}{% + \pnode(-5,\rA){A}\pnode(\rB,5){B}\pnode(\rC,-5){C}% + \pspolygon[linecolor=blue](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=0+0.5,\rB=5+-0.5,\rC=0+-0.5}{10}{% + \pnode(-5,\rA){A}\pnode(5,\rB){B}\pnode(\rC,-5){C}% + \pspolygon[linecolor=red](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=-5+0.5,\rB=0+-0.5,\rC=-5+0.5}{10}{% + \pnode(\rA,5){A}\pnode(5,\rB){B}\pnode(-5,\rC){C}% + \pspolygon[linecolor=cyan](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=0+0.5,\rB=5+-0.5,\rC=0+0.5}{10}{% + \pnode(\rA,5){A}\pnode(\rB,-5){B}\pnode(-5,\rC){C}% + \pspolygon[linecolor=magenta](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=5+-0.5,\rB=0+-0.5,\rC=-5+0.5}{10}{% + \pnode(5,\rA){A}\pnode(\rB,-5){B}\pnode(\rC,5){C}% + \pspolygon[linecolor=blue](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=0+-0.5,\rB=-5+0.5,\rC=0+0.5}{10}{% + \pnode(5,\rA){A}\pnode(-5,\rB){B}\pnode(\rC,5){C}% + \pspolygon[linecolor=red](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=5+-0.5,\rB=0+0.5,\rC=5+-0.5}{10}{% + \pnode(\rA,-5){A}\pnode(-5,\rB){B}\pnode(5,\rC){C}% + \pspolygon[linecolor=cyan](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } + \multido{\rA=0+-0.5,\rB=-5+0.5,\rC=0+-0.5}{10}{% + \pnode(\rA,-5){A}\pnode(\rB,5){B}\pnode(5,\rC){C}% + \pspolygon[linecolor=magenta](A)(B)(C)% + \focalPoint(A)(B)(C){SP}% + } +\end{pspicture} +\end{document} |