summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-26 22:09:25 +0000
committerKarl Berry <karl@freefriends.org>2020-02-26 22:09:25 +0000
commit72d53c78195f62dc7d8b66f7399ef0c8c2ccdc6f (patch)
tree6efc7a0541f9aafb98c252e77720a03f8340e3e2 /Master/texmf-dist/tex/generic
parent1075953981346648a99aee4d0682481538afce3b (diff)
pst-eucl (26feb20)
git-svn-id: svn://tug.org/texlive/trunk@53929 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.tex203
1 files changed, 180 insertions, 23 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 68dbf939fb5..c5e67dae20e 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.70}
-\def\filedate{2020/01/29}
+\def\fileversion{1.71}
+\def\filedate{2020/02/26}
%%
\message{`PST-Euclide v\fileversion, \filedate\space (dr,hv)}%
%% prologue for postcript
@@ -287,6 +287,31 @@
\@ifnextchar(\Pst@Geonode@ii{\pst@MngTransformCurve\endgroup}}% DR 22032005
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% \pstPolygon[options](A)(B)(C)(D)...
+%% create a polygon with some given node names, unlike the native pstrick pspolygon macro,
+%% this macro group the options as local variables, i.e, it is same as
+%% \begingroup
+%% \pspolygon[options](A)(B)(C)(D)...
+%% \endgroup
+%% if you use pspolygon without the begingroup and endgroup, then the options will be
+%% used for the subsequent macros.
+%%
+%% #1 -> options
+%% #2,#3,#4,... -> node names
+\def\pstPolygon{\@ifnextchar[\Pst@Polygon{\Pst@Polygon[]}}
+\def\Pst@Polygon[#1]{%
+ \begingroup
+ \xdef\@@GenCourbe{}%%for accumulating points
+ \psset{#1}%
+ \ifx\psk@CurveType\@none\psset{CurveType=polygon}\fi
+ \pstPolygon@ii%
+}
+\def\pstPolygon@ii(#1){%
+ \xdef\@@GenCourbe{\@@GenCourbe(#1)}%
+ \@ifnextchar(\pstPolygon@ii{\pst@MngTransformCurve\endgroup}%
+}%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Create a point with an associated node, in a new
%% landmark
%% #1 -> options
@@ -1079,13 +1104,11 @@
%% #3 -> [input] the node A on the circle or empty if you setup Radius/Diameter
%% #4 -> [input] optional. start angle from angleA to angleB, going counter clockwise.
%% #5 -> [input] optional, start angle from angleA to angleB, going counter clockwise.
-\def\pstCircleOA{\@ifnextchar[\Pst@CircleOA{\Pst@CircleOA[]}}
-\def\Pst@CircleOA[#1]#2#3{%
- \begingroup
- \psset{#1}%
- \def\pst@circle@center{#2}
- \def\pst@circle@node{#3}
- \@ifnextchar[\pstCircleOA@i{\pstCircleOA@j}}%
+\def\pstCircleOA{\pst@object{Pst@CircleOA}}
+\def\Pst@CircleOA@i#1#2{%
+ \def\pst@circle@center{#1}%
+ \def\pst@circle@node{#2}%
+ \@ifnextchar[\pstCircleOA@i\pstCircleOA@j}%
\def\pstCircleOA@i[#1][#2]{%
\begin@OpenObj
\def\pst@linetype{4}%
@@ -1100,11 +1123,9 @@
\else\psk@Radius\space
\fi
end
- %\psk@dimen CLW mul sub 0 360 arc closepath}%
- #1 #2 arc}%
+ \psk@dimen CLW mul sub #1 #2 arc}%
\showpointsfalse
\end@OpenObj
- \endgroup%
}%
\def\pstCircleOA@j{%
\begin@ClosedObj
@@ -1120,19 +1141,15 @@
\else\psk@Radius\space
\fi
end
- %\psk@dimen CLW mul sub 0 360 arc closepath}%
- 0 360 arc closepath}%
+ \psk@dimen CLW mul sub 0 360 arc closepath}%
\showpointsfalse
\end@ClosedObj
- \endgroup%
}%
%% #2 #3 -> 2 nodes defining a diameter of the circle
-\def\pstCircleAB{\@ifnextchar[\Pst@CircleAB{\Pst@CircleAB[]}}
-\def\Pst@CircleAB[#1]#2#3{%
- \begingroup
- \psset{#1}%
- \def\pst@circle@diameter@A{#2}
- \def\pst@circle@diameter@B{#3}
+\def\pstCircleAB{\pst@object{Pst@CircleAB}}
+\def\Pst@CircleAB@i#1#2{%
+ \def\pst@circle@diameter@A{#1}
+ \def\pst@circle@diameter@B{#2}
\@ifnextchar[\pstCircleAB@i{\pstCircleAB@j}}%
\def\pstCircleAB@i[#1][#2]{%
\Pst@MiddleAB[PointSymbol=none, PointName=none]{\pst@circle@diameter@B}{\pst@circle@diameter@A}{PST@CIRCLE@MAB}
@@ -1147,7 +1164,6 @@
\psk@dimen\space CLW mul sub #1 #2 arc}%
\showpointsfalse
\end@OpenObj
- \endgroup%
}%
\def\pstCircleAB@j{%
\Pst@MiddleAB[PointSymbol=none, PointName=none]{\pst@circle@diameter@B}{\pst@circle@diameter@A}{PST@CIRCLE@MAB}
@@ -1162,7 +1178,6 @@
\psk@dimen\space CLW mul sub 0 360 arc closepath}%
\showpointsfalse
\end@ClosedObj
- \endgroup%
}%
%% #2 #3 #4 -> 3 nodes defining the center and two points on the circle
\def\pstArcOAB{\pst@object{pstArcOAB}}%
@@ -2306,6 +2321,46 @@
\endgroup
}%
%
+%% \pstTriangleNC[Options]{A}{B}{C}{N}[M1][M2][M3]
+%% Draw the nine point circle 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 nine point circle center N
+%% #6 -> [output] the optional output Middle of BC
+%% #7 -> [output] the optional output Middle of CA
+%% #8 -> [output] the optional output Middle of AB
+\def\pstTriangleNC{\@ifnextchar[\Pst@TriangleNC{\Pst@TriangleNC[]}}
+\def\Pst@TriangleNC[#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@N{#5}
+ \@ifnextchar[\Pst@TriangleNC@i{\Pst@TriangleNC@j[BC_M][CA_M][AB_M]}}
+\def\Pst@TriangleNC@i[#1][#2][#3]{%
+ \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}
+ \pstMiddleAB[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{\pst@triangle@node@B}{#3}
+ \pstTriangleOC[PointName=none,PointSymbol=none]{#1}{#2}{#3}[\pst@triangle@node@N]
+ \Pst@ManageParamList{\pst@triangle@node@N}%
+ \Pst@ManageParamList{#1}%
+ \Pst@ManageParamList{#2}%
+ \Pst@ManageParamList{#3}%
+ \endgroup
+}%
+\def\Pst@TriangleNC@j[#1][#2][#3]{%
+ \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}
+ \pstMiddleAB[PointName=none,PointSymbol=none]{\pst@triangle@node@A}{\pst@triangle@node@B}{#3}
+ \pstTriangleOC{#1}{#2}{#3}[\pst@triangle@node@N]
+ \endgroup
+}%
+%
%% Distance between two points
\def\pstDist#1#2{%
tx@EcldDict begin /N@#1 GetNode /N@#2 GetNode ABDist end
@@ -4338,6 +4393,57 @@
\endgroup%
}%
%
+%% \pstGeneralEllipseFFN[Options]{F1}{F2}{N}{O}{R}{\theta}
+%% Calculate the center and the radii of a General Ellipse with two focus $F_1$, $F_2$, and one node $N$ on it,
+%% then you can access the ellipse with them.
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the given focus F_1
+%% #3 -> [input] the given focus F_2
+%% #4 -> [input] the given node N on the ellipse
+%% #5 -> [output] the center of the ellipse.
+%% #6 -> [output] the pair of major and minor radius of the ellipse.
+%% #7 -> [output] the rotation of the ellipse major axis.
+\def\pstGeneralEllipseFFN{\@ifnextchar[\Pst@GeneralEllipseFFN{\Pst@GeneralEllipseFFN[]}}
+\def\Pst@GeneralEllipseFFN[#1]#2#3#4#5#6#7{
+ \begingroup
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempFa%
+ \pst@getcoor{#3}\pst@tempFb%
+ \pst@getcoor{#4}\pst@tempN%
+ \pnode(!
+ \pst@tempFa \tx@UserCoor /Fay ED /Fax ED
+ \pst@tempFb \tx@UserCoor /Fby ED /Fbx ED
+ \pst@tempN \tx@UserCoor /Ny ED /Nx ED
+ Fax Fbx add 2 div /EllipseOx ED
+ Fay Fby add 2 div /EllipseOy ED
+ Fax Fay Fbx Fby
+ tx@EcldDict begin ABDist end
+ 2 div /EllipseC ED
+ Nx Ny Fax Fay
+ tx@EcldDict begin ABDist end
+ Nx Ny Fbx Fby
+ tx@EcldDict begin ABDist end
+ add 2 div /EllipseA ED
+ EllipseA dup mul EllipseC dup mul sub sqrt /EllipseB ED
+ Fay Fby lt {
+ Fby Fay sub Fbx Fax sub atan /#7 ED
+ } {
+ Fay Fby sub Fax Fbx sub atan /#7 ED
+ } ifelse
+ EllipseOx EllipseOy
+ ){#5}
+ \Pst@geonodelabel{#5}%
+ \pnode(! EllipseA EllipseB){#6}
+ \ifPst@CodeFig
+ \begingroup\psset{PointName=none,linecolor=\psk@CodeFigColor}
+ \pstLineAB[nodesep=-0.6]{#2}{#3}
+ \pstLineAA[nodesepA=-1.5,nodesepB=-0.5]{#5}{#7 90 add}{PST@ELLIPSE@Y}
+ \endgroup
+ \fi
+ \endgroup%
+}%
+%
%% \pstGeneralEllipseFle[Options]{F}{l_A}{l_B}{e}{O}{R}{\theta}
%% Calculate the center and the radii of a General Ellipse with directrix line $l$, focus $F$ and eccentricity $e$,
%% then you can access the ellipse with them.
@@ -8502,6 +8608,57 @@
}%
}%
%
+%% \pstGeneralHyperbolaFFN[Options]{F1}{F2}{N}{O}{R}{\theta}
+%% Calculate the center and the radii of a General Hyperbola with two focus $F_1$, $F_2$, and one node $N$ on it,
+%% then you can access the hyperbola with them.
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the given focus F_1
+%% #3 -> [input] the given focus F_2
+%% #4 -> [input] the given node N on the hyperbola
+%% #5 -> [output] the center of the hyperbola.
+%% #6 -> [output] the pair of major and minor radius of the hyperbola.
+%% #7 -> [output] the rotation of the hyperbola major axis.
+\def\pstGeneralHyperbolaFFN{\@ifnextchar[\Pst@GeneralHyperbolaFFN{\Pst@GeneralHyperbolaFFN[]}}
+\def\Pst@GeneralHyperbolaFFN[#1]#2#3#4#5#6#7{
+ \begingroup
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempFa%
+ \pst@getcoor{#3}\pst@tempFb%
+ \pst@getcoor{#4}\pst@tempN%
+ \pnode(!
+ \pst@tempFa \tx@UserCoor /Fay ED /Fax ED
+ \pst@tempFb \tx@UserCoor /Fby ED /Fbx ED
+ \pst@tempN \tx@UserCoor /Ny ED /Nx ED
+ Fax Fbx add 2 div /HyperbolaOx ED
+ Fay Fby add 2 div /HyperbolaOy ED
+ Fax Fay Fbx Fby
+ tx@EcldDict begin ABDist end
+ 2 div /HyperbolaC ED
+ Nx Ny Fax Fay
+ tx@EcldDict begin ABDist end
+ Nx Ny Fbx Fby
+ tx@EcldDict begin ABDist end
+ sub 2 div abs /HyperbolaA ED
+ HyperbolaC dup mul HyperbolaA dup mul sub sqrt /HyperbolaB ED
+ Fay Fby lt {
+ Fby Fay sub Fbx Fax sub atan /#7 ED
+ } {
+ Fay Fby sub Fax Fbx sub atan /#7 ED
+ } ifelse
+ HyperbolaOx HyperbolaOy
+ ){#5}
+ \Pst@geonodelabel{#5}%
+ \pnode(! HyperbolaA HyperbolaB){#6}
+ \ifPst@CodeFig
+ \begingroup\psset{PointName=none,linecolor=\psk@CodeFigColor}
+ \pstLineAB[nodesep=-0.6]{#2}{#3}
+ \pstLineAA[nodesepA=-1.5,nodesepB=-0.5]{#5}{#7 90 add}{PST@HYPERBOLA@Y}
+ \endgroup
+ \fi
+ \endgroup%
+}%
+%
%% \pstGeneralHyperbolaFle[Options]{F}{l_A}{l_B}{e}{O}{R}{\theta}
%% Calculate the center and the radii of a General Hyperbola with directrix line $l$, focus $F$ and eccentricity $e$,
%% then you can access the hyperbola with them.