diff options
author | Karl Berry <karl@freefriends.org> | 2014-05-18 21:48:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-05-18 21:48:17 +0000 |
commit | f478b27f4c3e827a33448774c884200ea9bcbbd9 (patch) | |
tree | 16f9425f85e4080762d553e40165e75999989871 /Master/texmf-dist/tex/generic/pst-eucl | |
parent | 2ddd4d3dcf4a1d8efc9177207e878137e6aa056f (diff) |
pst-eucl (18may14)
git-svn-id: svn://tug.org/texlive/trunk@34104 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-eucl')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex | 374 |
1 files changed, 241 insertions, 133 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex b/Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex index 681f993be7d..e93085ddcb5 100644 --- a/Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex +++ b/Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex @@ -12,16 +12,17 @@ % Require PSTricks and pst-node packages \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi \ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi +\ifx\PSTtoolsLoaded\endinput\else\input pst-tools.tex\fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey\fi \ifx\MultidoLoaded\endinput \else\input multido.tex \fi \csname PSTEuclideLoaded\endcsname \let\PSTEuclideLoaded\endinput -\def\fileversion{1.50} -\def\filedate{2014/04/05} +\def\fileversion{1.51} +\def\filedate{2014/05/17} %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN %% archives in directory macros/latex/base/lppl.txt. -\message{`PST-Euclide v\fileversion, \filedate\space (Dominique RODRIGUEZ)}% +\message{`PST-Euclide v\fileversion, \filedate\space (dr,hv)}% \message{ This version uses the pst-xkey package for managing parameters}% \message{ Please read the doc, some macros have a new syntax}% \message{ use option old for upward compatibility}% @@ -33,26 +34,27 @@ % Definition of the parameters % ---------------------------- % symbol used for the point -\define@key[psset]{pst-eucl}{PointSymbol}{\edef\psk@PointSymbol{#1}}% -\define@key[psset]{pst-eucl}{PointSymbolA}{\edef\psk@PointSymbolA{#1}}% -\define@key[psset]{pst-eucl}{PointSymbolB}{\edef\psk@PointSymbolB{#1}}% -\define@key[psset]{pst-eucl}{PointSymbolC}{\edef\psk@PointSymbolC{#1}}% +\define@key[psset]{pst-eucl}{PointSymbol}[default]{\def\psk@PointSymbol{#1}}% +\define@key[psset]{pst-eucl}{PointSymbolA}[undef]{\edef\psk@PointSymbolA{#1}}% +\define@key[psset]{pst-eucl}{PointSymbolB}[undef]{\edef\psk@PointSymbolB{#1}}% +\define@key[psset]{pst-eucl}{PointSymbolC}[undef]{\edef\psk@PointSymbolC{#1}}% % name used for the point -\define@key[psset]{pst-eucl}{PointName}{\def\psk@PointName{#1}}% -\define@key[psset]{pst-eucl}{PointNameA}{\def\psk@PointNameA{#1}}% -\define@key[psset]{pst-eucl}{PointNameB}{\def\psk@PointNameB{#1}}% -\define@key[psset]{pst-eucl}{PointNameC}{\def\psk@PointNameC{#1}}% + +\define@key[psset]{pst-eucl}{PointName}[default]{\def\psk@PointName{#1}}% +\define@key[psset]{pst-eucl}{PointNameA}[undef]{\edef\psk@PointNameA{#1}}% +\define@key[psset]{pst-eucl}{PointNameB}[undef]{\edef\psk@PointNameB{#1}}% +\define@key[psset]{pst-eucl}{PointNameC}[undef]{\edef\psk@PointNameC{#1}}% % use math mode in point name \newif\ifPst@PtNameMath% \define@key[psset]{pst-eucl}{PtNameMath}[false]{\@nameuse{Pst@PtNameMath#1}}% % symbol used for marking equal length segment -\define@key[psset]{pst-eucl}{SegmentSymbol}{\edef\psk@SegmentSymbol{#1}}% -\define@key[psset]{pst-eucl}{SegmentSymbolA}{\edef\psk@SegmentSymbolA{#1}}% -\define@key[psset]{pst-eucl}{SegmentSymbolB}{\edef\psk@SegmentSymbolB{#1}}% -\define@key[psset]{pst-eucl}{SegmentSymbolC}{\edef\psk@SegmentSymbolC{#1}}% -\define@key[psset]{pst-eucl}{Mark}{\def\psk@Mark{#1}}% -\define@key[psset]{pst-eucl}{mark}{\def\psk@mark{Angle#1}}% for angles -\define@key[psset]{pst-eucl}{MarkAngle}{\def\psk@MarkAngle{#1}}% +\define@key[psset]{pst-eucl}{SegmentSymbol}[MarkHashh]{\edef\psk@SegmentSymbol{#1}}% +\define@key[psset]{pst-eucl}{SegmentSymbolA}[MarkHashh]{\edef\psk@SegmentSymbolA{#1}}% +\define@key[psset]{pst-eucl}{SegmentSymbolB}[MarkHashh]{\edef\psk@SegmentSymbolB{#1}}% +\define@key[psset]{pst-eucl}{SegmentSymbolC}[MarkHashh]{\edef\psk@SegmentSymbolC{#1}}% +\define@key[psset]{pst-eucl}{Mark}[undef]{\edef\psk@Mark{#1}}% +\define@key[psset]{pst-eucl}{mark}[undef]{\edef\psk@mark{Angle#1}}% for angles +\define@key[psset]{pst-eucl}{MarkAngle}[undef]{\edef\psk@MarkAngle{#1}}% \newdimen\psMarkHashLength \newdimen\psMarkHashSep \define@key[psset]{pst-eucl}{MarkHashLength}[1.25mm]{\pssetlength\psMarkHashLength{#1}} @@ -63,29 +65,28 @@ \define@key[psset]{pst-eucl}{PointNameSep}{\edef\psk@PointNameSep{#1}}% % position angle for positionning a point name \define@key[psset]{pst-eucl}{PosAngle}{\edef\psk@PosAngle{#1}}% -\define@key[psset]{pst-eucl}{PosAngleA}{\edef\psk@PosAngleA{#1}}% -\define@key[psset]{pst-eucl}{PosAngleB}{\edef\psk@PosAngleB{#1}}% -\define@key[psset]{pst-eucl}{PosAngleC}{\edef\psk@PosAngleC{#1}}% +\define@key[psset]{pst-eucl}{PosAngleA}[undef]{\edef\psk@PosAngleA{#1}}% +\define@key[psset]{pst-eucl}{PosAngleB}[undef]{\edef\psk@PosAngleB{#1}}% +\define@key[psset]{pst-eucl}{PosAngleC}[undef]{\edef\psk@PosAngleC{#1}}% % dimension of the right angle mark -\define@key[psset]{pst-eucl}{RightAngleSize}{\edef\psk@RightAngleSize{#1}}% -\define@key[psset]{pst-eucl}{RightAngleType}{\edef\psk@RightAngleType{#1}}% +\define@key[psset]{pst-eucl}{RightAngleSize}[4]{\edef\psk@RightAngleSize{#1}}% +\define@key[psset]{pst-eucl}{RightAngleType}[default]{\edef\psk@RightAngleType{#1}}% % radius of an angle mark -\define@key[psset]{pst-eucl}{MarkAngleRadius}{\edef\psk@MarkAngleRadius{#1}}% +\define@key[psset]{pst-eucl}{MarkAngleRadius}[0.4]{\edef\psk@MarkAngleRadius{#1}}% % angular offset position of the label for marking an angle -\define@key[psset]{pst-eucl}{LabelAngleOffset}{\edef\psk@LabelAngleOffset{#1}}% +\define@key[psset]{pst-eucl}{LabelAngleOffset}[0]{\edef\psk@LabelAngleOffset{#1}}% % position radius of the label for marking an angle -\define@key[psset]{pst-eucl}{LabelSep}{\edef\psk@LabelSep{#1}}% +\define@key[psset]{pst-eucl}{LabelSep}[1]{\edef\psk@LabelSep{#1}}% % ref point of the label -\define@key[psset]{pst-eucl}{LabelRefPt}{\edef\psk@LabelRefPt{#1}}% +\define@key[psset]{pst-eucl}{LabelRefPt}[c]{\edef\psk@LabelRefPt{#1}}% % curve type for point list -\define@key[psset]{pst-eucl}{CurveType}{\edef\psk@CurveType{#1}}% +\define@key[psset]{pst-eucl}{CurveType}[none]{\edef\psk@CurveType{#1}}% % coefficient of homothetie -\define@key[psset]{pst-eucl}{HomCoef}{\edef\psk@HomCoef{#1}}% +\define@key[psset]{pst-eucl}{HomCoef}[0.5]{\edef\psk@HomCoef{#1}}% % angle of rotation -\define@key[psset]{pst-eucl}{RotAngle}{\edef\psk@RotAngle{#1}}% +\define@key[psset]{pst-eucl}{RotAngle}[60]{\edef\psk@RotAngle{#1}}% % label for coding the transfortion -\define@key[psset]{pst-eucl}{TransformLabel}{\edef\psk@TransformLabel{#1}}% -\define@key[psset]{pst-eucl}{CurveType}{\edef\psk@CurveType{#1}}% +\define@key[psset]{pst-eucl}{TransformLabel}[none]{\edef\psk@TransformLabel{#1}}% % private parameter \newif\ifPst@CentralSym \define@key[psset]{pst-eucl}{Central@Sym}[false]{\@nameuse{Pst@CentralSym#1}}% @@ -93,38 +94,41 @@ \newif\ifPst@DrawCirABC \define@key[psset]{pst-eucl}{DrawCirABC}[true]{\@nameuse{Pst@DrawCirABC#1}}% % for coding a construction -\newif\ifPst@CodeFig -\define@key[psset]{pst-eucl}{CodeFig}[false]{\@nameuse{Pst@CodeFig#1}}% +\define@boolkey[psset]{pst-eucl}[Pst@]{CodeFig}[true]{} +%\define@boolkey[psset]{pst-eucl}[Pst@]{CodeFigA}[true]{\def\psk@CodeFigA{#1}} +%\define@boolkey[psset]{pst-eucl}[Pst@]{CodeFigB}[true]{\def\psk@CodeFigB{#1}} \newif\ifPst@CodeFigA -\define@key[psset]{pst-eucl}{CodeFigA}{\edef\psk@CodeFigA{#1}\@nameuse{Pst@CodeFigA#1}}% +\define@key[psset]{pst-eucl}{CodeFigA}[undef]{\edef\psk@CodeFigA{#1}\@nameuse{Pst@CodeFigA#1}}% \newif\ifPst@CodeFigB -\define@key[psset]{pst-eucl}{CodeFigB}{\edef\psk@CodeFigB{#1}\@nameuse{Pst@CodeFigB#1}}% -\define@key[psset]{pst-eucl}{CodeFigColor}{\edef\psk@CodeFigColor{#1}}% -\define@key[psset]{pst-eucl}{CodeFigStyle}{\edef\psk@CodeFigStyle{#1}}% +\define@key[psset]{pst-eucl}{CodeFigB}[undef]{\edef\psk@CodeFigB{#1}\@nameuse{Pst@CodeFigB#1}}% + +\define@key[psset]{pst-eucl}{CodeFigColor}[cyan]{\edef\psk@CodeFigColor{#1}}% +\define@key[psset]{pst-eucl}{CodeFigStyle}[dashed]{\edef\psk@CodeFigStyle{#1}}% \newif\ifPst@CodeFigAarc% \define@key[psset]{pst-eucl}{CodeFigAarc}[true]{\@nameuse{Pst@CodeFigAarc#1}} \newif\ifPst@CodeFigBarc% \define@key[psset]{pst-eucl}{CodeFigBarc}[true]{\@nameuse{Pst@CodeFigBarc#1}} %% for specifying a distance for the circle -\define@key[psset]{pst-eucl}{Radius}{\edef\psk@Radius{#1}}% -\define@key[psset]{pst-eucl}{RadiusA}{\edef\psk@RadiusA{#1}}% -\define@key[psset]{pst-eucl}{RadiusB}{\edef\psk@RadiusB{#1}}% -\define@key[psset]{pst-eucl}{Diameter}{\edef\psk@Diameter{#1}}% -\define@key[psset]{pst-eucl}{DiameterA}{\edef\psk@DiameterA{#1}}% -\define@key[psset]{pst-eucl}{DiameterB}{\edef\psk@DiameterB{#1}}% +\define@key[psset]{pst-eucl}{Radius}[none]{\edef\psk@Radius{#1}}% +\define@key[psset]{pst-eucl}{RadiusA}[undef]{\edef\psk@RadiusA{#1}}% +\define@key[psset]{pst-eucl}{RadiusB}[undef]{\edef\psk@RadiusB{#1}}% +\define@key[psset]{pst-eucl}{Diameter}[none]{\edef\psk@Diameter{#1}}% +\define@key[psset]{pst-eucl}{DiameterA}[undef]{\edef\psk@DiameterA{#1}}% +\define@key[psset]{pst-eucl}{DiameterB}[undef]{\edef\psk@DiameterB{#1}}% % for specifying a distance for the circle -\define@key[psset]{pst-eucl}{DistCoef}{\edef\psk@DistCoef{#1}}% -\define@key[psset]{pst-eucl}{AngleCoef}{\edef\psk@AngleCoef{#1}}% +\define@key[psset]{pst-eucl}{DistCoef}[none]{\edef\psk@DistCoef{#1}}% +\define@key[psset]{pst-eucl}{AngleCoef}[none]{\edef\psk@AngleCoef{#1}}% % for curvilign abscissa placement \newif\ifPst@CurvAbsNeg% \define@key[psset]{pst-eucl}{CurvAbsNeg}[false]{\@nameuse{Pst@CurvAbsNeg#1}}% % first and last point of a generic curve -\define@key[psset]{pst-eucl}{GenCurvFirst}{\edef\psk@GenCurvFirst{#1}}% -\define@key[psset]{pst-eucl}{GenCurvLast}{\edef\psk@GenCurvLast{#1}}% +\define@key[psset]{pst-eucl}{GenCurvFirst}[none]{\edef\psk@GenCurvFirst{#1}}% +\define@key[psset]{pst-eucl}{GenCurvLast}[none]{\edef\psk@GenCurvLast{#1}}% % increment of a generic curve -\define@key[psset]{pst-eucl}{GenCurvInc}{\edef\psk@GenCurvInc{#1}}% +\define@key[psset]{pst-eucl}{GenCurvInc}[1]{\edef\psk@GenCurvInc{#1}}% %% Default values % -------------- +\def\resetEUCLvalues{% \psset{% PointSymbol=default, PointSymbolA=undef, PointSymbolB=undef, PointSymbolC=undef, PointName=default, PointNameA=undef, PointNameB=undef, PointNameC=undef, @@ -138,8 +142,9 @@ CodeFigB=undef, CodeFigAarc=true, CodeFigBarc=true, Radius=none, RadiusA=undef, RadiusB=undef, Diameter=none, DiameterA=undef, DiameterB=undef, DistCoef=none, AngleCoef=none, CurvAbsNeg=false, GenCurvFirst=none, GenCurvLast=none, - GenCurvInc=1}%}% -\SpecialCoor %% for using polar coordinates, node position, ... + GenCurvInc=1}} +\resetEUCLvalues +%\SpecialCoor %% for using polar coordinates, node position, ... \psset{dimen=middle}% remark of ML \def\@undef{undef}% \def\@default{default}% @@ -148,6 +153,7 @@ \def\@polygon{polygon} \def\@polyline{polyline} \def\@curve{curve} +\def\@none{none} \def\tx@PtoC{ tx@Dict begin PtoC end } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%%%%%%%% \pst@newnode is already defined in pst-node @@ -270,12 +276,13 @@ end}% %%end modif DR 11/2003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% #1 -> point coordinates -\def\Pst@geonodelabel#1{%% {nodename} - \ifx\psk@PointSymbol\@none\else% - \ifx\psk@PointSymbol\@default\edef\psk@PointSymbol{*}\fi% +\def\Pst@geonodelabel#1{% % {nodename} + \ifx\psk@PointSymbol\@none\else + \ifx\psk@PointSymbol\@default \def\psk@PointSymbol{*}\fi \psdot[dotstyle=\psk@PointSymbol](#1)% + \Pst@PutPointLabel{#1}%DR 041104 \fi%DR 02092004 - \Pst@PutPointLabel{#1}%DR 041104 + \ifx\psk@PointName\@none\else\Pst@PutPointLabel{#1}\fi%DR 041104 }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\Pst@PutPointLabel#1{%DR 041104 @@ -308,7 +315,7 @@ end}% \let\Anglepstslashslash=\Anglepstslashh% \let\Anglepstslashslashslash=\Anglepstslashhh% %%begin modif alaindelplanque 11/2003 -%%begin modif Germain Boxer 04/2014 +%%begin modif Germain Boyer 04/2014 \def\MarkHash{% \rput{\ifx\psk@MarkAngle\@undef45\else\psk@MarkAngle\fi} {\psline(-\psMarkHashLength,0)(\psMarkHashLength,0)}} @@ -366,34 +373,36 @@ end}% % %%end modif alaindelplanque 11/2003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% #2 #3 #4 -> 3 nodes for defining the right angle -\def\pstRightAngle{\@ifnextchar[\Pst@RightAngle{\Pst@RightAngle[]}}% -\def\Pst@RightAngle[#1]#2#3#4{% - \bgroup\psset{#1}% % Affectation of local parameters +%% #1 #2 #3 -> 3 nodes for defining the right angle +\def\pstRightAngle{\pst@object{pstRightAngle}} +\def\pstRightAngle@i#1#2#3{% + \begingroup + \addbefore@par{linestyle=solid,linecolor=black,linewidth=\pslinewidth} + \use@par% % Affectation of local parameters %% not good at all, but \rput{0}(#3){\rput{(#2)}{stuff}} doesn't work... - \rput(#3){% + \rput(#2){% \ifx\psk@RightAngleType\@default% \pspolygon(0,0)%%modif 12/2004 - (!tx@EcldDict begin /N@#4 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end)% - (!tx@EcldDict begin /N@#4 GetNode exch Atan /N@#2 GetNode exch Atan + (!tx@EcldDict begin /N@#3 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end)% + (!tx@EcldDict begin /N@#3 GetNode exch Atan /N@#1 GetNode exch Atan 2 copy sub abs 91 gt { 2 copy lt { exch 360 add exch } { 360 add } ifelse } if %%DR 2005/01/14 %%2 copy lt { exch 360 sub exch } if add 2 div 2 sqrt \psk@RightAngleSize\space mul exch PtoC end)% - (!tx@EcldDict begin /N@#2 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end)% + (!tx@EcldDict begin /N@#1 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end)% \else\ifx\psk@RightAngleType\@german% - \pstMarkAngle[MarkAngleRadius=\psk@RightAngleSize,LabelSep=\psk@RightAngleSize\space .5 mul]{#2}{#3}{#4}% + \pstMarkAngle[MarkAngleRadius=\psk@RightAngleSize,LabelSep=\psk@RightAngleSize\space .5 mul]{#1}{#2}{#3}% {\psscalebox{\psk@RightAngleSize}{\pscircle*{.08}}}% \else\ifx\psk@RightAngleType\@suisseromand% \rput{*0}% - (!tx@EcldDict begin /N@#4 GetNode exch Atan /N@#2 GetNode exch Atan + (!tx@EcldDict begin /N@#3 GetNode exch Atan /N@#1 GetNode exch Atan 2 copy lt { exch 360 sub exch } if add 2 div .45 \psk@RightAngleSize\space mul exch PtoC end)% {\psscalebox{\psk@RightAngleSize}{\pscircle*{.08}}}% \pspolygon(0,0)% - (!tx@EcldDict begin /N@#4 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end )% - (!tx@EcldDict begin /N@#2 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end )% + (!tx@EcldDict begin /N@#3 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end )% + (!tx@EcldDict begin /N@#1 GetNode exch Atan \psk@RightAngleSize\space exch PtoC end )% \fi\fi\fi}% - \egroup\ignorespaces% hv 20130312 + \endgroup\ignorespaces% hv 20130312 }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% #2 #3 #4 -> 3 nodes for defining the angle @@ -641,7 +650,7 @@ end}% exch){\pnode{\@image}}% }%%end rput \xdef\@@GenCourbe{\@@GenCourbe(\@image)}%%for accumulating points - \ifPst@CentralSym\ifPst@CodeFig% + \ifPst@CentralSym\ifPst@CodeFig \edef\psk@OldSegmentSymbol{\psk@SegmentSymbol}% \edef\psk@SegmentSymbol{\expandafter\PstParamListFirst\psk@OldSegmentSymbol,undef/}% \ifx\psk@SegmentSymbol\@undef\edef\psk@SegmentSymbol{\LastValidSS}\else\edef\LastValidSS{\psk@SegmentSymbol}\fi @@ -679,7 +688,7 @@ end}% exch){\pnode{#2}}% }%%end rput \xdef\@@GenCourbe{\@@GenCourbe(#2)}%%for accumulating points - \ifPst@CentralSym\ifPst@CodeFig% + \ifPst@CentralSym\ifPst@CodeFig \edef\psk@OldSegmentSymbol{\psk@SegmentSymbol}% \edef\psk@SegmentSymbol{\expandafter\PstParamListFirst\psk@OldSegmentSymbol,undef/}% \ifx\psk@SegmentSymbol\@undef\edef\psk@SegmentSymbol{\LastValidSS}\else\edef\LastValidSS{\psk@SegmentSymbol}\fi @@ -716,7 +725,7 @@ end}% %%end modif alaindelplanque 11/2003 \expandafter\ifx\csname psteucl@old\endcsname\relax\Pst@HomO[]{#2}{#3}[#4]% \else\Pst@HomO[]{#2}{#3}{#4}\fi%%%DR 14042005 - \ifPst@CodeFig% + \ifPst@CodeFig \psset{linecolor=\psk@CodeFigColor, linestyle=\psk@CodeFigStyle}% \pstSegmentMark{#2}{#4}% \pstSegmentMark{#4}{#3}% @@ -772,9 +781,9 @@ end}% \ncline{#5}{@Middle#2#3}% \ncline{#5}{@Middle#2#4}% \psset{linestyle=solid}% - \Pst@RightAngle[]{#5}{@Middle#4#3}{#4}% - \Pst@RightAngle[]{#5}{@Middle#2#3}{#3}% - \Pst@RightAngle[]{#5}{@Middle#2#4}{#2}% + \pstRightAngle[]{#5}{@Middle#4#3}{#4}% + \pstRightAngle[]{#5}{@Middle#2#3}{#3}% + \pstRightAngle[]{#5}{@Middle#2#4}{#2}% \Pst@SegmentMark[SegmentSymbol=\psk@SegmentSymbolA]{#4}{@Middle#4#3}% \Pst@SegmentMark[SegmentSymbol=\psk@SegmentSymbolA]{@Middle#4#3}{#3}% \Pst@SegmentMark[SegmentSymbol=\psk@SegmentSymbolB]{#3}{@Middle#2#3}% @@ -821,8 +830,8 @@ end}% {\pnode{\@image}}% }% \xdef\@@GenCourbe{\@@GenCourbe(\@image)}%%for accumulating points - \ifPst@CodeFig% - \bgroup% + \ifPst@CodeFig + \bgroup \psset{linecolor=\psk@CodeFigColor, linestyle=\psk@CodeFigStyle}% \ncline[arrows=->,nodesep=0]{\@antecedent}{\@image} \ifx\psk@TransformLabel\@none @@ -987,17 +996,18 @@ end}% %% #7 -> label %% #8 -> node name of the second point %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\pstInterLC{\@ifnextchar[\Pst@InterLC{\Pst@InterLC[]}}% -\def\Pst@InterLC[#1]#2#3#4#5#6#7{% - \bgroup% - \psset{#1}% % Affectation of local parameters - \rput(#4){% +\def\pstInterLC{\pst@object{pstInterLC}} +\def\pstInterLC@i#1#2#3#4#5#6{% + \begingroup + \pst@killglue + \use@par + \rput(#3){% \pnode(! tx@EcldDict begin - /N@#2 GetNode /N@#3 GetNode 4 copy EqDr + /N@#1 GetNode /N@#2 GetNode 4 copy EqDr \ifx\psk@Radius\@none \ifx\psk@Diameter\@none - /N@#4 GetNode /N@#5 GetNode ABDist + /N@#3 GetNode /N@#4 GetNode ABDist \else\psk@Diameter 2 div \fi \else\psk@Radius @@ -1005,21 +1015,25 @@ end}% InterLineCircle /Glby exch def /Glbx exch def \pst@number\psyunit div exch \pst@number\psxunit div exch 2 copy end - /#6.Y exch def /#6.X exch def % save the coors for futher use - ){#6}% + /#5.Y exch def /#5.X exch def % save the coors for futher use + ){#5}% \rput(! tx@EcldDict begin Glbx \pst@number\psxunit div Glby \pst@number\psyunit div - end){\pnode{#7}}}% - \bgroup\ifx\psk@PosAngleA\@undef\else\psset{PosAngle=\psk@PosAngleA}\fi% - \ifx\psk@PointSymbolA\@undef\else\psset{PointSymbol=\psk@PointSymbolA}\fi% - \ifx\psk@PointNameA\@undef\else\psset{PointName=\psk@PointNameA}\fi% - \Pst@geonodelabel{#6}\egroup% - \ifx\psk@PosAngleB\@undef\else\psset{PosAngle=\psk@PosAngleB}\fi% - \ifx\psk@PointSymbolB\@undef\else\psset{PointSymbol=\psk@PointSymbolB}\fi% - \ifx\psk@PointNameB\@undef\else\psset{PointName=\psk@PointNameB}\fi% - \Pst@geonodelabel{#7}% - \egroup% + end){\pnode{#6}} + }% + \bgroup + \ifx\psk@PosAngleA\@undef\else\psset{PosAngle=\psk@PosAngleA}\fi + \ifx\psk@PointSymbolA\@undef\else\psset{PointSymbol=\psk@PointSymbolA}\fi + \ifx\psk@PointNameA\@undef\else\psset{PointName=\psk@PointNameA}\fi + \Pst@geonodelabel{#5} + \egroup + \ifx\psk@PosAngleB\@undef\else\psset{PosAngle=\psk@PosAngleB}\fi + \ifx\psk@PointSymbolB\@undef\else\psset{PointSymbol=\psk@PointSymbolB}\fi + \ifx\psk@PointNameB\@undef\else\psset{PointName=\psk@PointNameB}\fi + \Pst@geonodelabel{#6}% + \endgroup + \ignorespaces }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Intersection between two circles @@ -1072,26 +1086,36 @@ end}% end)% {\pnode{#7}}% }% - \bgroup\ifx\psk@PosAngleA\@undef\else\psset{PosAngle=\psk@PosAngleA}\fi - \ifx\psk@PointSymbolA\@undef\else\psset{PointSymbol=\psk@PointSymbolA}\fi - \ifx\psk@PointNameA\@undef\else\psset{PointName=\psk@PointNameA}\fi - \Pst@geonodelabel{#6}\egroup% - \bgroup\ifx\psk@PosAngleB\@undef\else\psset{PosAngle=\psk@PosAngleB}\fi - \ifx\psk@PointSymbolB\@undef\else\psset{PointSymbol=\psk@PointSymbolB}\fi - \ifx\psk@PointNameB\@undef\else\psset{PointName=\psk@PointNameB}\fi - \Pst@geonodelabel{#7}\egroup% + \bgroup +% \ifx\psk@PosAngleA\@undef\else\psset{PosAngle=\psk@PosAngleA}\fi +% \ifx\psk@PointSymbolA\@undef\else\psset{PointSymbol=\psk@PointSymbolA}\fi +% \ifx\psk@PointNameA\@undef\else\psset{PointName=\psk@PointNameA}\fi + \ifx\psk@PosAngleA\@undef\else\ifx\psk@PosAngleA\@none\else\psset{PosAngle=\psk@PosAngleA}\fi\fi + \ifx\psk@PointSymbolA\@undef\else\ifx\psk@PointSymbolA\@none\else\psset{PointSymbol=\psk@PointSymbolA}\fi\fi + \ifx\psk@PointNameA\@undef\else\ifx\psk@PointNameA\@none\else\psset{PointName=\psk@PointNameA}\fi\fi + \ifx\psk@PosAngleA\@undef\else\ifx\psk@PointSymbolA\@none\else\Pst@geonodelabel{#6}\fi\fi + \egroup + \bgroup +% \ifx\psk@PosAngleB\@undef\else\psset{PosAngle=\psk@PosAngleB}\fi +% \ifx\psk@PointSymbolB\@undef\else\psset{PointSymbol=\psk@PointSymbolB}\fi +% \ifx\psk@PointNameB\@undef\else\psset{PointName=\psk@PointNameB}\fi + \ifx\psk@PosAngleA\@undef\else\ifx\psk@PosAngleB\@none\else\psset{PosAngle=\psk@PosAngleB}\fi\fi + \ifx\psk@PointSymbolB\@undef\else\ifx\psk@PointSymbolB\@none\else\psset{PointSymbol=\psk@PointSymbolB}\fi\fi + \ifx\psk@PointNameB\@undef\else\ifx\psk@PointNameB\@none\else\psset{PointName=\psk@PointNameB}\fi\fi + \ifx\psk@PosAngleB\@undef\else\ifx\psk@PointSymbolB\@none\else\Pst@geonodelabel{#7}\fi\fi + \egroup \psset{linecolor=\psk@CodeFigColor, linestyle=\psk@CodeFigStyle, arcsep=-1}% \ifx\psk@CodeFigA\@undef% \ifx\psk@CodeFigB\@undef\ifPst@CodeFig\ifPst@CodeFigAarc\pstArcOAB{#2}{#6}{#7}\else\pstArcnOAB{#2}{#6}{#7}\fi\fi\fi \else% - \ifPst@CodeFigA\ifPst@CodeFigAarc\pstArcOAB{#2}{#6}{#7}\else\pstArcnOAB{#2}{#6}{#7}\fi\fi% + \ifx\psk@CodeFigA\@none \ifPst@CodeFigA\ifPst@CodeFigAarc\pstArcOAB{#2}{#6}{#7}\else\pstArcnOAB{#2}{#6}{#7}\fi\fi\fi \fi \ifx\psk@CodeFigB\@undef% \ifx\psk@CodeFigA\@undef\ifPst@CodeFig\ifPst@CodeFigBarc\pstArcOAB{#4}{#6}{#7}\else\pstArcnOAB{#4}{#6}{#7}\fi\fi\fi - \else% - \ifPst@CodeFigB\ifPst@CodeFigBarc\pstArcOAB{#4}{#6}{#7}\else\pstArcnOAB{#4}{#6}{#7}\fi\fi% + \else + \ifx\psk@CodeFigB\@none \ifPst@CodeFigB\ifPst@CodeFigBarc\pstArcOAB{#4}{#6}{#7}\else\pstArcnOAB{#4}{#6}{#7}\fi\fi\fi \fi - \egroup% + \egroup }% %% Intersection between two functions %% #2 #3 -> f and g (functions) @@ -1143,34 +1167,34 @@ end}% \egroup% } %% Intersection between a function and a circle -%% #2 -> f (function) -%% #3 #4 -> points defining the circle (center and point) -%% #5 -> approximation of the root -%% #6 -> node name of the first point -\def\pstInterFC{\@ifnextchar[\Pst@InterFC{\Pst@InterFC[]}}% -\def\Pst@InterFC[#1]#2#3#4#5#6{% - \bgroup\psset{#1}% % Affectation of local parameters -% \rput(! -% tx@EcldDict begin -% #5 { /N@#3 GetNode 2 copy /N@#4 GetNode ABDist \pst@number\psxunit div -% 3 1 roll \pst@number\psyunit div exch \pst@number\psxunit div exch x #2 ABDist sub } { 0 } NewtonSolving pop -% pop dup /x exch def #2 -% end){\pnode{#6}}% +%% #1 -> f (function) +%% #2 #3 -> points defining the circle (center and point) +%% #4 -> approximation of the root +%% #5 -> node name of the first point +\def\pstInterFC{\pst@object{pstInterFC}}% +\def\pstInterFC@i#1#2#3#4#5{% + \begingroup + \pst@killglue + \use@par + \edef\@function{ \ifPst@algebraic (#1) AlgParser cvx exec \else #1 \fi\space }% \pnode(! tx@EcldDict begin - #5 - { /N@#3 GetNode 2 copy /N@#4 GetNode ABDist \pst@number\psxunit div - 3 1 roll \pst@number\psyunit div exch \pst@number\psxunit div exch x #2 ABDist sub } + #4 + { /N@#2 GetNode 2 copy /N@#3 GetNode ABDist \pst@number\psxunit div + 3 1 roll \pst@number\psyunit div exch \pst@number\psxunit div exch x \@function + ABDist sub } { 0 } NewtonSolving pop pop dup /x exch def - \ifPst@algebraic (#2) AlgParser cvx exec \else #2 \fi + \@function 2 copy end - /#5.Y exch def /#5.X exch def % save the coors for futher use - ){#6}% - \Pst@geonodelabel{#6}% - \egroup% + /#4.Y exch def /#4.X exch def % save the coors for futher use + ){#5}% + \Pst@geonodelabel{#5}% + \endgroup + \ignorespaces } + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ORTHOGONAL PROJECTION %% #2 #3 -> nodes defining the line where to project @@ -1304,7 +1328,7 @@ end}% \bgroup \Pst@Projection@iv{\@antecedent}{@ProjOrth\@antecedent on\@FrstPt\@ScdPt} \psset{linecolor=\psk@CodeFigColor, linestyle=\psk@CodeFigStyle}% - \Pst@RightAngle[linestyle=solid]{\@FrstPt}{@ProjOrth\@antecedent on\@FrstPt\@ScdPt}{\@antecedent}% + \pstRightAngle[linestyle=solid]{\@FrstPt}{@ProjOrth\@antecedent on\@FrstPt\@ScdPt}{\@antecedent}% \Pst@SegmentMark[]{\@image}{@ProjOrth\@antecedent on\@FrstPt\@ScdPt}% \Pst@SegmentMark[]{@ProjOrth\@antecedent on\@FrstPt\@ScdPt}{\@antecedent}% \egroup @@ -1342,7 +1366,7 @@ end}% \bgroup \Pst@Projection@ii{#1}{@ProjOrth#1on\@FrstPt\@ScdPt} \psset{linecolor=\psk@CodeFigColor, linestyle=\psk@CodeFigStyle}% - \Pst@RightAngle[linestyle=solid]{\@FrstPt}{@ProjOrth#1on\@FrstPt\@ScdPt}{#1}% + \pstRightAngle[linestyle=solid]{\@FrstPt}{@ProjOrth#1on\@FrstPt\@ScdPt}{#1}% \Pst@SegmentMark[]{#2}{@ProjOrth#1on\@FrstPt\@ScdPt}% \Pst@SegmentMark[]{@ProjOrth#1on\@FrstPt\@ScdPt}{#1}% \egroup @@ -1376,7 +1400,7 @@ end}% \egroup \ifPst@CodeFig \bgroup\psset{linecolor=\psk@CodeFigColor} - \Pst@RightAngle[]{#3}{#4}{#5} + \pstRightAngle[]{#3}{#4}{#5} \Pst@SegmentMark[]{#2}{#4}\Pst@SegmentMark[]{#4}{#3}% \egroup \fi @@ -1523,8 +1547,92 @@ end}% \psk@AngleCoef\space mul \fi } -\catcode`\@=\PstAtCode\relax +% +\def\psGetDistanceAB{\pst@object{psGetDistanceAB}}% Thmoas Söll 20140512 +\def\psGetDistanceAB@i(#1)(#2)#3{% +\begingroup% +\pst@killglue +\use@par +\pst@getcoor{#1}\pst@tempA +\pst@getcoor{#2}\pst@tempB +\pnode(! + 15 dict begin + /dec \psk@decimals\space def + \psk@PSfont findfont \psk@fontscale scalefont setfont + /laenge {10 dec exp mul round 10 dec exp div 15 string cvs stringwidth } def + /Wert { 10 dec exp mul round 10 dec exp div dec 0 eq {cvi 15 string cvs} {15 string cvs } ifelse + \ifPst@comma dot2comma \fi show } def + \pst@tempA \tx@UserCoor /y1 ED /x1 ED + \pst@tempB \tx@UserCoor /y2 ED /x2 ED + \pst@tempA /y3 ED /x3 ED + \pst@tempB /y4 ED /x4 ED + x3 x4 sub y3 y4 sub Pyth laenge /dx ED + x3 x4 add 2 div dx 2 div sub \psk@xShift\space add y3 y4 add 2 div \psk@yShift\space add + moveto % + x1 x2 sub y1 y2 sub Pyth Wert + x1 x2 add 2 div y1 y2 add 2 div + end ){#3} +\endgroup +\ignorespaces +} +% +\define@boolkey[psset]{pst-eucl}[Pst@]{AngleValue}[false]{} +\define@boolkey[psset]{pst-eucl}[Pst@]{AngleArc}[true]{} +\define@boolkey[psset]{pst-eucl}[Pst@]{ShowWedge}[true]{} +\define@key[psset]{pst-eucl}{ArcColor}{\def\psk@ArcColor{#1}}% +\define@key[psset]{pst-eucl}{WedgeColor}{\def\psk@WedgeColor{#1}}% +\define@key[psset]{pst-eucl}{WedgeOpacity}{\def\psk@WedgeOpacity{#1}}% +\psset[pst-eucl]{ArcColor=black,WedgeColor=blue,WedgeOpacity=0.2,AngleValue=false, + AngleArc,ShowWedge} +\def\psGetAngleABC{\pst@object{psGetAngleABC}}% Thmoas Söll 20140512 +\def\psGetAngleABC@i(#1)(#2)(#3)#4{% + \begingroup + \use@par + \pst@killglue + \pst@getcoor{#1}\pst@tempA + \pst@getcoor{#2}\pst@tempB + \pst@getcoor{#3}\pst@tempC + \pst@Verb{ + \pst@tempA \tx@UserCoor /y1 ED /x1 ED + \pst@tempB \tx@UserCoor /y2 ED /x2 ED + \pst@tempC \tx@UserCoor /y3 ED /x3 ED + y1 y2 sub x1 x2 sub Atan neg /delta1 ED + y3 y2 sub x3 x2 sub Atan neg /delta2 ED + delta1 delta2 le {180 delta2 delta1 add 2 div neg add /WiM ED} {delta2 delta1 add 2 div neg /WiM ED} ifelse + } + \ifPst@ShowWedge + \pswedge[fillstyle=solid,fillcolor=\psk@WedgeColor,opacity=\psk@WedgeOpacity](#2){\psk@MarkAngleRadius}{! delta1}{! delta2}% + \fi + \ifPst@AngleArc + \psarc[linecolor=\psk@ArcColor](#2){\psk@MarkAngleRadius}{! delta1}{! delta2}% + \fi + \pnode(! % + /dec \psk@decimals\space def + \psk@PSfont findfont \psk@fontscale scalefont setfont + /s1 { /Symbol findfont \psk@fontscale\space scalefont setfont } bind def + /laenge {10 dec exp mul round 10 dec exp div 15 string cvs stringwidth } def + /WertZeigen {10 dec exp mul round 10 dec exp div dec 0 eq {cvi 15 string cvs} {15 string cvs } ifelse + \ifPst@comma dot2comma \fi show s1 (\string\260) show} def + \pst@tempA \tx@UserCoor /y1 ED /x1 ED + \pst@tempB \tx@UserCoor /y2 ED /x2 ED + \pst@tempC \tx@UserCoor /y3 ED /x3 ED + y1 y2 sub x1 x2 sub Atan neg /delta1 ED + y3 y2 sub x3 x2 sub Atan neg /delta2 ED + delta1 delta2 le {360 delta2 delta1 sub abs sub /WiWert ED} {delta2 delta1 sub abs /WiWert ED} ifelse + delta1 delta2 le {180 delta2 delta1 add 2 div neg add /WiM ED} {delta2 delta1 add 2 div neg /WiM ED} ifelse + \psk@MarkAngleRadius\space delta2 delta1 add 2 div PtoC \pst@tempB exch pop add /ym1 ED \pst@tempB pop add /xm1 ED + xm1 \psk@MarkAngleRadius\space WiM cos mul \pst@number\psxunit mul add \psk@xShift\space add ym1 + \psk@MarkAngleRadius\space WiM sin mul \pst@number\psxunit mul add \psk@yShift\space add moveto % + \ifPst@AngleValue WiWert WertZeigen \fi + x2 0.8 WiM cos mul add y2 0.8 WiM sin mul add){#2-M}% + \uput{\psk@LabelSep}[! WiM]{0}(#2){#4}% + \endgroup + \ignorespaces +} +% +\catcode`\@=\PstAtCode\relax +% \endinput %% %% END pst-eps.tex |