summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pstricks-examples/14-05-1.ltx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/pstricks-examples/14-05-1.ltx')
-rw-r--r--Master/texmf-dist/doc/latex/pstricks-examples/14-05-1.ltx57
1 files changed, 57 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pstricks-examples/14-05-1.ltx b/Master/texmf-dist/doc/latex/pstricks-examples/14-05-1.ltx
new file mode 100644
index 00000000000..a7c46662c02
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstricks-examples/14-05-1.ltx
@@ -0,0 +1,57 @@
+%%
+%% Ein Beispiel der DANTE-Edition
+%%
+%%
+%% Copyright (C) 2010 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[]{exaarticle}
+\pagestyle{empty}
+\setlength\textwidth{190.324pt}
+\setlength\parindent{0pt}
+\StartShownPreambleCommands
+\usepackage{pstricks,pst-node,pst-xkey}\SpecialCoor
+\makeatletter
+\define@boolkey[psset]{}[Pst@]{zeigeSP}[true]{}% Schwerpunkt markieren?
+\psset{zeigeSP=true} % Vorgabe
+\def\Schwerpunkt{\pst@object{Schwerpunkt}}
+\def\Schwerpunkt@i(#1)(#2)(#3)#4{%
+ \pst@getcoor{#1}\pst@tempA% Punkt A % hole Kordinaten als x y
+ \pst@getcoor{#2}\pst@tempB% Punkt B % "
+ \pst@getcoor{#3}\pst@tempC% Punkt C % "
+ \begin@SpecialObj % Parameter setzen
+ \pnode(!% % setze Knoten
+ \pst@tempA /YA exch \pst@number\psyunit div def
+ /XA exch \pst@number\psxunit div def % x y in user Koordinaten
+ \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 = Knotenname
+ \ifPst@zeigeSP\qdisk(#4){2pt}\fi% markieren?
+ \end@SpecialObj%
+ \ignorespaces}
+\makeatother
+\StopShownPreambleCommands
+\begin{document}
+\begin{pspicture}[showgrid](4,4) \psset{linewidth=2pt}
+ \pspolygon[linecolor=red](0,0)(2,4)(4,0)%
+ \Schwerpunkt[zeigeSP,linecolor=red](0,0)(2,4)(4,0){SP1}%
+ \pnode(0,0){A}\pnode(0,4){B}\pnode(4,2){C}%
+ \pspolygon[linecolor=blue](A)(B)(C)%
+ \Schwerpunkt(A)(B)(C){SP2}%
+ {\psset{linecolor=blue}\qdisk(SP2){2pt}}
+ \ncline[linewidth=0.2pt]{<->}{SP1}{SP2}%
+\end{pspicture}
+\end{document}