diff options
author | Karl Berry <karl@freefriends.org> | 2020-01-09 22:10:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-01-09 22:10:39 +0000 |
commit | 628c0a8ab5e4b3003d81d49732f20d3d51f4e292 (patch) | |
tree | 5b4326ab00df7fd653b587b3535bb493675dce28 /Master/texmf-dist/tex/generic | |
parent | 8477f4227bbc1db8d01f1011640ccea3f73849df (diff) |
pst-eucl (9jan20)
git-svn-id: svn://tug.org/texlive/trunk@53354 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex | 257 |
1 files changed, 204 insertions, 53 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 c4b7b532963..6cc2f9b54e9 100644 --- a/Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex +++ b/Master/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex @@ -20,8 +20,8 @@ \csname PSTEuclideLoaded\endcsname \let\PSTEuclideLoaded\endinput % -\def\fileversion{1.68} -\def\filedate{2019/11/21} +\def\fileversion{1.69} +\def\filedate{2020/01/09} %% \message{`PST-Euclide v\fileversion, \filedate\space (dr,hv)}% %% prologue for postcript @@ -533,8 +533,12 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% #2 #4 #6 -> coordinates for nodes %% #3 #5 #7 -> nodes name -\def\pstTriangle{\pst@object{pstTriangle}}% -\def\pstTriangle@i{\@ifnextchar(\pstTriangle@ii{\pstTriangle@ii(0,0)}}% +\def\pstTriangle{\@ifnextchar[\Pst@Triangle{\Pst@Triangle[]}} +\def\Pst@Triangle[#1]{% + \begingroup + \psset{#1}% + \@ifnextchar(\pstTriangle@ii{\pstTriangle@ii(0,0)}% +} \def\pstTriangle@ii(#1)#2(#3)#4(#5)#6{% \pst@killglue %%begin modif alaindelplanque 11/2003 @@ -597,7 +601,7 @@ \Pst@Geonode@i[](#5){#6}%%NEW DR 15112001 \pst@TraceTriangle{#2}{#4}{#6}% \egroup -}% +\endgroup}% % \def\pst@TraceTriangle#1#2#3{\pspolygon(#1)(#2)(#3)}% % @@ -1055,8 +1059,13 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Line, circle, Arc %% #2 #3 -> 2 nodes defining the line -\def\pstLineAB{\ncline}%@ifnextchar[\Pst@LineAB{\Pst@LineAB[]}}% -%\def\Pst@LineAB[#1]#2#3{\ncline[#1]{#2}{#3}}% +\def\pstLineAB{\@ifnextchar[\Pst@LineAB{\Pst@LineAB[]}}% +\def\Pst@LineAB[#1]#2#3{% + \begingroup + \psset{#1}% + \ncline{#2}{#3} + \endgroup% +}% % %% \pstCircleOA[Options]{O}{A}[angleA][angleB] %% Draw a Circle with center O from angleA to angleB, going counter clockwise. @@ -1986,13 +1995,12 @@ \def\Pst@MediatorAB[#1]#2#3#4#5{% \bgroup\psset{#1}% % Affectation of local parameters \bgroup - \let\PointSymbol=\psk@PointSymbolA + \ifx\psk@PointSymbolA\@none\let\psk@PointSymbol=\@none\else\let\psk@PointSymbol=\psk@PointSymbolA\fi \ifx\psk@PointNameA\@undef\else\psset{PointName=\psk@PointNameA}\fi - %\Pst@HomO[HomCoef=.5]{#2}{#3}{#4} - \Pst@MiddleAB[]{#2}{#3}{#4} + \Pst@MiddleAB[]{#2}{#3}{#4} \egroup \bgroup - \let\PointSymbol=\psk@PointSymbolB + \ifx\psk@PointSymbolB\@none\let\psk@PointSymbol=\@none\else\let\psk@PointSymbol=\psk@PointSymbolB\fi \ifx\psk@PointNameB\@undef\else\psset{PointName=\psk@PointNameB}\fi \expandafter\ifx\csname psteucl@old\endcsname\relax% \Pst@Rotation[RotAngle=90, CodeFig=false]{#4}{#3}[#5]%%%DR 26032005 @@ -2107,22 +2115,6 @@ \expandafter\pscurve\@@GenCourbe \egroup% }% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Parallel line -%% #2 #3 -> nodes defining the line -%% #3 -> antecedent node -%% #4 -> node name of the image -%% #5 -> label -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Orthogonal line -%% #2 #3 -> nodes defining the line -%% #3 -> antecedent node -%% #4 -> node name of the image -%% #5 -> label -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Special macros for parameters -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% \pstTriangleIC[Options]{A}{B}{C}[I][D] %% Draw the inner circle of triangle ABC @@ -2132,34 +2124,45 @@ %% #3 -> [input] the node B %% #4 -> [input] the node C %% #5 -> [output] optional, the inner circle center I -%% #6 -> [output] optional, the node on inner circle +%% #6 -> [output] optional, the node D on inner circle \def\pstTriangleIC{\@ifnextchar[\Pst@TriangleIC{\Pst@TriangleIC[]}} \def\Pst@TriangleIC[#1]#2#3#4{% \begingroup \@InitListMng % - % we should output none point name and symbol as default - % to compat with the old version. - \psset{PointName=none,PointSymbol=none} - % then comes the user local options. \psset{#1}% \def\pst@triangle@node@a{#2} \def\pst@triangle@node@b{#3} \def\pst@triangle@node@c{#4} - \@ifnextchar[\Pst@TriangleIC@i{\Pst@TriangleIC@i[IC_O]}} + \@ifnextchar[\Pst@TriangleIC@i{\Pst@TriangleIC@j[IC_O]}} \def\Pst@TriangleIC@i[#1]{% \def\pst@triangle@inner@center{#1} - \@ifnextchar[\Pst@TriangleIC@j{\Pst@TriangleIC@j[IC_OAB]}} -\def\Pst@TriangleIC@j[#1]{% - \begingroup - \psset{PointSymbol=none,PointName=none,linestyle=none,CodeFig=false} - \pstBissectBAC{\pst@triangle@node@c}{\pst@triangle@node@a}{\pst@triangle@node@b}{@PST@TRIANGLE@IC_BC} - \pstBissectBAC{\pst@triangle@node@b}{\pst@triangle@node@c}{\pst@triangle@node@a}{@PST@TRIANGLE@IC_AB} - \pstInterLL{\pst@triangle@node@c}{@PST@TRIANGLE@IC_AB}{\pst@triangle@node@a}{@PST@TRIANGLE@IC_BC}{\pst@triangle@inner@center} - \pstProjection{\pst@triangle@node@a}{\pst@triangle@node@b}{\pst@triangle@inner@center}[#1] - \endgroup - \pstCircleOA{\pst@triangle@inner@center}{#1} + \@ifnextchar[\Pst@TriangleIC@ii{\Pst@TriangleIC@ij[IC_OAB]}} +\def\Pst@TriangleIC@ii[#1]{% display both I and D + \def\pst@triangle@inner@IBC{#1} + \Pst@TriangleIC@k% \Pst@ManageParamList{\pst@triangle@inner@center}% - \Pst@ManageParamList{#1}% + \Pst@ManageParamList{\pst@triangle@inner@IBC}% + \endgroup +}% +\def\Pst@TriangleIC@ij[#1]{% display I only + \def\pst@triangle@inner@IBC{#1} + \Pst@TriangleIC@k% + \Pst@ManageParamList{\pst@triangle@inner@center}% + \endgroup +}% +\def\Pst@TriangleIC@j[#1]{% display none point + \def\pst@triangle@inner@center{#1} + \def\pst@triangle@inner@IBC{IC_OAB} + \Pst@TriangleIC@k% + \endgroup +}% +\def\Pst@TriangleIC@k{% display none point + \begingroup + \pstBissectBAC[PointSymbol=none,PointName=none,linestyle=none,CodeFig=false]{\pst@triangle@node@c}{\pst@triangle@node@a}{\pst@triangle@node@b}{@PST@TRIANGLE@IC_BC} + \pstBissectBAC[PointSymbol=none,PointName=none,linestyle=none,CodeFig=false]{\pst@triangle@node@b}{\pst@triangle@node@c}{\pst@triangle@node@a}{@PST@TRIANGLE@IC_AB} + \pstInterLL[PointSymbol=none,PointName=none]{\pst@triangle@node@c}{@PST@TRIANGLE@IC_AB}{\pst@triangle@node@a}{@PST@TRIANGLE@IC_BC}{\pst@triangle@inner@center} + \pstProjection[PointSymbol=none,PointName=none]{\pst@triangle@node@a}{\pst@triangle@node@b}{\pst@triangle@inner@center}[\pst@triangle@inner@IBC] + \pstCircleOA{\pst@triangle@inner@center}{\pst@triangle@inner@IBC} \endgroup }% % @@ -2174,23 +2177,132 @@ \def\pstTriangleOC{\@ifnextchar[\Pst@TriangleOC{\Pst@TriangleOC[]}} \def\Pst@TriangleOC[#1]#2#3#4{% \begingroup - % we should output none point name and symbol as default - % to compat with the old version. - \psset{PointName=none,PointSymbol=none} - % then comes the user local options. \psset{#1}% \def\pst@triangle@node@a{#2} \def\pst@triangle@node@b{#3} \def\pst@triangle@node@c{#4} - \@ifnextchar[\Pst@TriangleOC@i{\Pst@TriangleOC@i[OC_O]}} + \@ifnextchar[\Pst@TriangleOC@i{\Pst@TriangleOC@j[OC_O]}} \def\Pst@TriangleOC@i[#1]{% - \begingroup - \psset{PointSymbol=none,PointName=none,CodeFig=false} - \pstCircleABC{\pst@triangle@node@a}{\pst@triangle@node@b}{\pst@triangle@node@c}{#1} - \endgroup + \pstCircleABC[PointSymbol=none,PointName=none,CodeFig=false]{\pst@triangle@node@a}{\pst@triangle@node@b}{\pst@triangle@node@c}{#1} \Pst@geonodelabel{#1}% \endgroup }% +\def\Pst@TriangleOC@j[#1]{% don't output the center point + \pstCircleABC[PointSymbol=none,PointName=none,CodeFig=false]{\pst@triangle@node@a}{\pst@triangle@node@b}{\pst@triangle@node@c}{#1} + \endgroup +}% +% +%% \pstTriangleGC[Options]{A}{B}{C}{G}[M1][M2] +%% Draw the gravity center of triangle ABC +%% Parameters: +%% #1 -> options +%% #2 -> [input] the node A +%% #3 -> [input] the node B +%% #4 -> [input] the node C +%% #5 -> [output] the output gravity center G +%% #6 -> [output] the optional output Middle of BC +%% #7 -> [output] the optional output Middle of CA +\def\pstTriangleGC{\@ifnextchar[\Pst@TriangleGC{\Pst@TriangleGC[]}} +\def\Pst@TriangleGC[#1]#2#3#4#5{% + \begingroup + \@InitListMng % + \psset{#1}% + \def\pst@triangle@node@A{#2} + \def\pst@triangle@node@B{#3} + \def\pst@triangle@node@C{#4} + \def\pst@triangle@node@G{#5} + \@ifnextchar[\Pst@TriangleGC@i{\Pst@TriangleGC@j[BC_M][CA_M]}} +\def\Pst@TriangleGC@i[#1][#2]{% + \pstMiddleAB[PointName=none,PointSymbol=none]{\pst@triangle@node@B}{\pst@triangle@node@C}{#1} + \pstMiddleAB[PointName=none,PointSymbol=none]{\pst@triangle@node@C}{\pst@triangle@node@A}{#2} + \pstInterLL[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{#1}{\pst@triangle@node@B}{#2}{\pst@triangle@node@G} + \Pst@ManageParamList{\pst@triangle@node@G}% + \Pst@ManageParamList{#1}% + \Pst@ManageParamList{#2}% + \endgroup +}% +\def\Pst@TriangleGC@j[#1][#2]{% + \pstMiddleAB[PointName=none,PointSymbol=none]{\pst@triangle@node@B}{\pst@triangle@node@C}{#1} + \pstMiddleAB[PointName=none,PointSymbol=none]{\pst@triangle@node@C}{\pst@triangle@node@A}{#2} + \pstInterLL[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{#1}{\pst@triangle@node@B}{#2}{\pst@triangle@node@G} + \Pst@ManageParamList{\pst@triangle@node@G}% + \endgroup +}% +% +%% \pstTriangleHC[Options]{A}{B}{C}{H}[H1][H2] +%% Draw the orthocenter of triangle ABC +%% Parameters: +%% #1 -> options +%% #2 -> [input] the node A +%% #3 -> [input] the node B +%% #4 -> [input] the node C +%% #5 -> [output] the output orthocenter H +%% #6 -> [output] the optional output perpendicular on BC +%% #7 -> [output] the optional output perpendicular on CA +\def\pstTriangleHC{\@ifnextchar[\Pst@TriangleHC{\Pst@TriangleHC[]}} +\def\Pst@TriangleHC[#1]#2#3#4#5{% + \begingroup + \@InitListMng % + \psset{#1}% + \def\pst@triangle@node@A{#2} + \def\pst@triangle@node@B{#3} + \def\pst@triangle@node@C{#4} + \def\pst@triangle@node@H{#5} + \@ifnextchar[\Pst@TriangleHC@i{\Pst@TriangleHC@j[BC_H][CA_H]}} +\def\Pst@TriangleHC@i[#1][#2]{% + \pstProjection[PointName=none,PointSymbol=none]{\pst@triangle@node@B}{\pst@triangle@node@C}{\pst@triangle@node@A}[#1] + \pstProjection[PointName=none,PointSymbol=none]{\pst@triangle@node@C}{\pst@triangle@node@A}{\pst@triangle@node@B}[#2] + \pstInterLL[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{#1}{\pst@triangle@node@B}{#2}{\pst@triangle@node@H} + \Pst@ManageParamList{\pst@triangle@node@H}% + \Pst@ManageParamList{#1}% + \Pst@ManageParamList{#2}% + \endgroup +}% +\def\Pst@TriangleHC@j[#1][#2]{% + \pstProjection[PointName=none,PointSymbol=none]{\pst@triangle@node@B}{\pst@triangle@node@C}{\pst@triangle@node@A}[#1] + \pstProjection[PointName=none,PointSymbol=none]{\pst@triangle@node@C}{\pst@triangle@node@A}{\pst@triangle@node@B}[#2] + \pstInterLL[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{#1}{\pst@triangle@node@B}{#2}{\pst@triangle@node@H} + \Pst@ManageParamList{\pst@triangle@node@H}% + \endgroup +}% +% +%% \pstTriangleEC[Options]{A}{B}{C}{E}[H] +%% Draw the center of the escribed circle which lying out of BC of triangle ABC. +% +%% Parameters: +%% #1 -> options +%% #2 -> [input] the node A +%% #3 -> [input] the node B +%% #4 -> [input] the node C +%% #5 -> [output] the output excenter E +%% #6 -> [output] the optional output perpendicular on BC +\def\pstTriangleEC{\@ifnextchar[\Pst@TriangleEC{\Pst@TriangleEC[]}} +\def\Pst@TriangleEC[#1]#2#3#4#5{% + \begingroup + \@InitListMng % + \psset{#1}% + \def\pst@triangle@node@A{#2} + \def\pst@triangle@node@B{#3} + \def\pst@triangle@node@C{#4} + \def\pst@triangle@node@E{#5} + \@ifnextchar[\Pst@TriangleEC@i{\Pst@TriangleEC@j[BC_H]}} +\def\Pst@TriangleEC@i[#1]{% + \pstBissectBAC[PointName=none,PointSymbol=none,linestyle=none]{\pst@triangle@node@B}{\pst@triangle@node@A}{\pst@triangle@node@C}{@PST@TRIANGLE@EC_BC} + \pstOutBissectBAC[PointName=none,PointSymbol=none,linestyle=none]{\pst@triangle@node@C}{\pst@triangle@node@B}{\pst@triangle@node@A}{@PST@TRIANGLE@EC_CA} + \pstInterLL[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{@PST@TRIANGLE@EC_BC}{\pst@triangle@node@B}{@PST@TRIANGLE@EC_CA}{\pst@triangle@node@E} + \pstProjection[PointName=none,PointSymbol=none]{B}{C}{\pst@triangle@node@E}[#1] + \Pst@ManageParamList{\pst@triangle@node@E}% + \Pst@ManageParamList{#1}% + \endgroup +}% +\def\Pst@TriangleEC@j[#1]{% + \pstBissectBAC[PointName=none,PointSymbol=none,linestyle=none]{\pst@triangle@node@B}{\pst@triangle@node@A}{\pst@triangle@node@C}{@PST@TRIANGLE@EC_BC} + \pstOutBissectBAC[PointName=none,PointSymbol=none,linestyle=none]{\pst@triangle@node@C}{\pst@triangle@node@B}{\pst@triangle@node@A}{@PST@TRIANGLE@EC_CA} + \pstInterLL[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{@PST@TRIANGLE@EC_BC}{\pst@triangle@node@B}{@PST@TRIANGLE@EC_CA}{\pst@triangle@node@E} + \pstProjection[PointName=none,PointSymbol=none]{B}{C}{\pst@triangle@node@E}[#1] + \Pst@ManageParamList{\pst@triangle@node@E}% + \endgroup +}% % %% Distance between two points \def\pstDist#1#2{% @@ -3102,6 +3214,45 @@ \endgroup% }% % +%% \pstCircleChordNode[Options]{O}{A}{L}{B} +%% Create a new node B on the Circle O such that the length of chord AB is the given value L. +%% The circle O is defined by center O and point A on the circle. +%% The direction can be controled by parameter CurvAbsNeg. +%% Parameters: +%% #1 -> options +%% #2 -> [input] the circle center O +%% #3 -> [input] the point A on the circle +%% #4 -> [input] the given chord length +%% #5 -> [output] the target node name B +\def\pstCircleChordNode{\@ifnextchar[\Pst@CircleChordNode{\Pst@CircleChordNode[]}} +\def\Pst@CircleChordNode[#1]{% + \begingroup + \psset{#1}% + \Pst@CircleChordNode@i} +\def\Pst@CircleChordNode@i#1#2#3#4{% + \pst@getcoor{#1}\pst@tempO% + \pst@getcoor{#2}\pst@tempA% + \pnode(! + \pst@tempO \tx@UserCoor % x0,y0 + \pst@tempA \tx@UserCoor % x1,y1 + 1 index 4 index sub dup mul 1 index 4 index sub dup mul add sqrt % R + 1 index 4 index sub 3 index 6 index sub atan % RotAngle of A + #3 \pst@number\psxunit\space div % chord length in user screen + 2 index 2 mul 1 index lt { + pop pop pop pop pop pop pop 0 0 + } { + 0 index 3 index dup mul 4 mul 2 index dup mul sub sqrt atan 2 mul % tan(AOB/2)=d/sqrt(4r^2-d^2) + \ifPst@CurvAbsNeg 2 index exch sub \else 2 index add \fi % RotAngle of B = RotAngle of A +/- <AOB + dup sin exch cos % sin(B) cos(B) + 4 index mul 8 index add exch % x=r*cos(AOB)+x0 + 4 index mul 7 index add % y=r*sin(AOB)+y0 + 9 2 roll pop pop pop pop pop pop pop + } ifelse + ){#4}% + \Pst@geonodelabel{#4}% + \endgroup% +}% +% %% \pstCircleTangentLine[Options]{O}{A}{T} %% Draw the tangent line from A on the circle, and give the other node B on the line. %% The circle O is defined by center O and point A on the circle. |