summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/euclideangeometry
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-04-11 22:24:25 +0000
committerKarl Berry <karl@freefriends.org>2020-04-11 22:24:25 +0000
commitf9a81c93678592ac9978df3ef83033a068067099 (patch)
tree25961cac473b1a0f37b619feedc0a2df15b86a26 /Master/texmf-dist/source/latex/euclideangeometry
parent591b80b11e2ee3890ac7419d50582dc3f27180c7 (diff)
euclideangeometry (10apr20)
git-svn-id: svn://tug.org/texlive/trunk@54659 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/euclideangeometry')
-rw-r--r--Master/texmf-dist/source/latex/euclideangeometry/euclideangeometry.dtx157
1 files changed, 133 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/latex/euclideangeometry/euclideangeometry.dtx b/Master/texmf-dist/source/latex/euclideangeometry/euclideangeometry.dtx
index 5710287c700..7305301abf4 100644
--- a/Master/texmf-dist/source/latex/euclideangeometry/euclideangeometry.dtx
+++ b/Master/texmf-dist/source/latex/euclideangeometry/euclideangeometry.dtx
@@ -45,7 +45,7 @@ This work consists of files:
%<package>\ProvidesPackage{euclideangeometry}%
%<readme>File README.txt for package euclideangeometry
%<*package|readme>
- [2020-02-12 v.0.1.5 Extension package for curve2e]
+ [2020-03-30 v.0.1.7 Extension package for curve2e]
%</package|readme>
%<*driver>
\documentclass{ltxdoc}\errorcontextlines=100
@@ -154,7 +154,7 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
% installed with your updated complete \TeX system installation.
% Please refer to the user manual before using this package.
-% \CheckSum{1108}
+% \CheckSum{1193}
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\StopEventually{}
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -215,7 +215,8 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
% is |\Pbox| and it produces a box containing the label in math format. By
% default the point label is typeset with the math font variant produced
% by command |\mathsf|, but the macro is sufficiently versatile to allow
-% other settings; It accepts several optional arguments, therefore it syntax is particular:
+% other settings; it accepts several optional arguments, therefore it
+% syntax is particular:
%\begin{ttsyntax}
%\cs{Pbox}\parg{coordinates}\oarg{alignment}\marg{label}\oarg{diameter}\meta{$\star$}\aarg{angle}
%\end{ttsyntax}
@@ -228,7 +229,9 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
% specification, the couple \texttt{cc} is assumed; most often than
% not, the label position becomes such that when the user reviews the
% document drafts, s/he understands immediately that s/he forgot to specify
-% some reasonable \meta{alignment} codes. Think of the \meta{alignment}
+% some reasonable \meta{alignment} codes; in any case the \texttt{cc} code
+% works fine to just put the dot of a specified diameter but with an empty
+% label. Think of the \meta{alignment}
% letters as the position of the reference point with respect to the
% the \meta{label} optical center. The optional \meta{angle} argument
% produces a rotation of the whole label by that angle; it may be used
@@ -238,23 +241,27 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
%
% The optional asterisk draws a frame around the \emph{label}. Notice that
% the separator between the visible or the invisible frame and the box
-% contents varies according the the fact the the \meta{alignment}
+% contents varies according the the fact that the \meta{alignment}
% specification contains just one or two letter codes; this is useful,
% because the diagonal position of the label should be optically equal
-% to the gap that exists between the reference point and the \meta{label}
+% to the gap that exists between the reference point and the \meta{label}
% box.
%
% If the \meta{diameter} is zero, no dot is drawn, the whole \meta{label}
% is typeset with the |\mathit| math font; otherwise only the first symbol
-% of a math expression si typeset in sans serif. The presence of subscripts
+% of a math expression is typeset in sans serif. The presence of subscripts
% makes the labels appear more distant from their reference point; the same
% is true when math symbols, even without subscripts, are used, because
-% of the oblique nature of the math letters alphabet.
+% of the oblique nature of the math ‘letters’ alphabet.
%
% If some text has to be printed as a label, it suffices to surround it
% with dollar signs, that switch back to text mode when the default mode
% is the math one. With this kind of textual labels it might be convenient
% to use the optional asterisk to frame the text.
+% The final optional argument \meta{angle} (to be delimited with the
+% \texttt{<~>} signs) specifies the inclination of the label with respect
+% to the horizontal line; it is useful, for example to set a label along
+% a sloping line.
% \begin{macrocode}
\providecommand\Pbox{}
\newlength\PbDim
@@ -577,6 +584,108 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
\let\MiddlePointOf\SegmentCenter
% \end{macrocode}
%
+% Some other macros are needed to solve certain triangle problems;
+% one of such macros is the one allows to determine the length of one
+% leg of a right triangle by knowing the lengths of the hypothenuse
+% and the other leg. The syntax is the following:
+%\begin{ttsyntax}
+%\cs{LegFromHypotenuse}\meta{hypothenuse} AndOtherLeg\meta{leg1} to\meta{leg2}
+%\end{ttsyntax}
+% where the three parameters may be macros, especially the last one;
+% all of them contina scalar values.
+%
+% \begin{macrocode}
+\def\LegFromHypotenuse#1AndOtherLeg#2to#3{%
+ \edef#3{\fpeval{sqrt(#1**2-#2**2)}}}
+% \end{macrocode}
+%
+% Another useful macro determines the two intersections of a line with
+% a circumference if they exist; otherwise it issues a warning and sets
+% both output values to vector \texttt{0,0}, which, of course, is wrong,
+% but it allows to go on with typesetting, although with non sense results.
+% Warnings do not stop the compilation program, therefore their message
+% goes to the \file{.log} file and the user might not notice it; but
+% since the results are probably absurd, s/he certainly notice this
+% fact and look for messages; the user, therefore, who has carefully
+% read this user manual, immediately looks onto the \file{.log} file
+% and realises the reason of the wrong results.
+%
+% The syntax of this macro is the following:
+%\begin{ttsyntax}
+%\cs{IntersectionsOfLine}\parg{point}\parg{direction} WithCircle\parg{center}\marg{radius} to\meta{int1} and\meta{int2}
+%\end{ttsyntax}
+% where \meta{point} and \meta{direction} are the line parameters
+% that can be explicit complex values or macros; \meta{center} is
+% the circumference explicit complex value, or a macro, containing
+% the center coordinates; \meta{radius} is the scalar explicit or
+% macro radius length; The intersection points \meta{int1} and
+% \meta{ind2} are supposed to be macros that get defined with the
+% intersection point coordinates; \meta{int1} is the first intersection
+% that is determined along the line \emph{direction}. Please notice the
+% different first part of the macro name \texttt{IntersectionsOfLine}
+% compared to the macro that determines the intersection of two lines
+% \texttt{IntersectionOfLines}: two intersections and one line vs. one
+% intersection with two lines.
+% \begin{macrocode}
+\def\IntersectionsOfLine(#1)(#2)WithCircle(#3)#4to#5and#6{%
+\CopyVect#3 to\C \edef\R{#4}
+\CopyVect#1to\Pu \CopyVect#2to\Pd
+\Circlewithcenter\C radius\R
+\segment(\Pu)(\Pd)\SegmentArg(\Pu)(\Pd)to\Diru
+\edef\Dird{\fpeval{\Diru+90}}\Pbox(\C)[b]{C}[2]
+\IntersectionOfLines(\Pu)(\Diru:1)and(\C)(\Dird:1)to\Int
+\SegmentLength(\C)(\Int)to\A
+\fptest{\A > \R}{\PackageError{euclideangeometry}%
+{Distance of line \A\space larger than radius \R. No intersections}%
+{Check your data; correct and retry}}{%
+\LegFromHypotenuse\R AndOtherLeg\A to\B
+\AddVect\Int and\Diru:-\B to\Pt \edef#5{\Pt}
+\SymmetricalPointOf\Pt respect\Int to\Pq \edef#6{\Pq}
+}}
+% \end{macrocode}
+%
+% Another useful macro determines the point \meta{p2} symmetric
+% to a given point \meta{p1} with respect to a given segment the
+% end points of which are \meta{Segm1} and \meta{Segm2}:
+%\begin{ttsyntax}
+%\cs{Segment}\parg{Segm1}\parg{Segm2}SymmetricPointOf\marg{p1} to\meta{p2}
+%\end{ttsyntax}
+% where, as usual, the input data may be explicit or macro defined
+% coordinates, while the output result should be a macro name.
+% \begin{macrocode}
+\def\Segment(#1)(#2)SymmetricPointOf#3to#4{%
+\SegmentArg(#1)(#2)to\Sanguno\edef\Sangdue{\fpeval{\Sanguno+90}}
+\IntersectionOfLines(#1)(\Sanguno:1)and(#3)(\Sangdue:1)to\Smed
+\SymmetricalPointOf#3respect\Smed to#4\ignorespaces}
+% \end{macrocode}
+%
+% Another useful macro draws a circle given its \meta{center} and the
+% coordinates of the \meta{ponit} which the circumference should pass
+% through. The syntax is:
+%\begin{ttsyntax}
+%\cs{CircleThrough}\parg{[point}WithCenter\marg{center}
+%\end{ttsyntax}
+% As usual, the parameters are all explicit or macro defined complex
+% numbers.
+% \begin{macrocode}
+\def\CircleThrough#1WithCenter#2{%
+\SegmentLength(#1)(#2)to\Radius
+\Circlewithcenter#2radius\Radius}
+% \end{macrocode}
+% The above macro is the building block for a simple macro that draws
+% two circles that cross at a given point; but it is so simple that
+% it is not worth defining a macro: if the user wants to try his/her
+% ability, s/he may define:
+%\begin{flushleft}\obeylines
+%| \NewDocumentCommand{r() r() r()}{%|
+%| \CircleThrough#3 WithCenter{#1}|
+%| \CircleThrough#3 WithCenter{#2}\ignorespaces}|
+%\end{flushleft}
+% where \cs{ignorespaces} may be superfluous, but is always a safety action
+% when defining commands to be used within the \amb{picture} environment.
+% In any case see example~XXX in \file{euclideangeometry-man.pdf}
+%^^A\ref{fig:twocircles-second intersection}.
+%
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Triangle special points}
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1195,7 +1304,7 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
% The overall macro that executes all the passages described in
% the above enumeration follows; the reader can easily recognise
% the various steps, since the names of the macros are self
-% explanatory; the $G_i$ point names are the symmetrical ones
+% explanatory; the $S_i$ point names are the symmetrical ones
% to the first focus $F$; the $M_i$ points are the centers of
% symmetry; the $F'$ point is the second focus; the $T_i$ points
% are the tangency points. The macro |\EllipseWithFOcus| has the
@@ -1225,26 +1334,26 @@ g\raisebox{-0.715ex}{\kern-0.26em u}\kern-0.13em\I\kern-0.14em t}\xspace}
\IntersectionOfLines(\Pd)(\Au:1)and(\F)(\fpeval{\Au+90}:1)to\Mu
\IfBooleanTF{#1}{\Pbox(\Mt)[br]{M_3}[1.5pt]\Pbox(\Md)[t]{M_2}[1.5pt]
\Pbox(\Mu)[b]{M_1}[1.5pt]}{}
-\SymmetricalPointOf\F respect\Mu to\Gu
-\IfBooleanTF{#1}{\Pbox(\Gu)[l]{G_1}[1.5pt]}{}
-\SymmetricalPointOf\F respect \Md to\Gd
-\IfBooleanTF{#1}{\Pbox(\Gd)[t]{G_2}[1.5pt]}{}
-\SymmetricalPointOf\F respect \Mt to\Gt
-\IfBooleanTF{#1}{\Pbox(\Gt)[r]{G_3}[1.5pt]}{}
-\IfBooleanTF{#1}{\ThreePointCircle*(\Gu)(\Gd)(\Gt)}%
- {\ThreePointCircle(\Gu)(\Gd)(\Gt)}
+\SymmetricalPointOf\F respect\Mu to\Su
+\IfBooleanTF{#1}{\Pbox(\Su)[l]{S_1}[1.5pt]}{}
+\SymmetricalPointOf\F respect \Md to\Sd
+\IfBooleanTF{#1}{\Pbox(\Sd)[t]{S_2}[1.5pt]}{}
+\SymmetricalPointOf\F respect \Mt to\St
+\IfBooleanTF{#1}{\Pbox(\St)[r]{S_3}[1.5pt]}{}
+\IfBooleanTF{#1}{\ThreePointCircle*(\Su)(\Sd)(\St)}%
+ {\ThreePointCircle(\Su)(\Sd)(\St)}
\CopyVect\C to\Fp \Pbox(\Fp)[l]{F'}[1.5pt]
\IfBooleanTF{#1}{%
-\Dotline(\F)(\Gt){2}[1.5pt]
-\Dotline(\F)(\Gd){2}[1.5pt]
-\Dotline(\F)(\Gu){2}[1.5pt]}{}
-\IntersectionOfSegments(\Pu)(\Pt)and(\Fp)(\Gt)to\Tt
-\IntersectionOfSegments(\Pu)(\Pd)and(\Fp)(\Gd)to\Td
-\IntersectionOfSegments(\Pd)(\Pt)and(\Fp)(\Gu)to\Tu
+\Dotline(\F)(\St){2}[1.5pt]
+\Dotline(\F)(\Sd){2}[1.5pt]
+\Dotline(\F)(\Su){2}[1.5pt]}{}
+\IntersectionOfSegments(\Pu)(\Pt)and(\Fp)(\St)to\Tt
+\IntersectionOfSegments(\Pu)(\Pd)and(\Fp)(\Sd)to\Td
+\IntersectionOfSegments(\Pd)(\Pt)and(\Fp)(\Su)to\Tu
\IfBooleanTF{#1}{\Pbox(\Tu)[l]{T_1}[1.5pt]
\Pbox(\Td)[b]{T_2}[1.5pt]
\Pbox(\Tt)[tl]{T_3}[1.5pt]
-\Dashline(\Fp)(\Gu){1}\Dashline(\Fp)(\Gd){1}\Dashline(\Fp)(\Gt){1}}{}
+\Dashline(\Fp)(\Su){1}\Dashline(\Fp)(\Sd){1}\Dashline(\Fp)(\St){1}}{}
\DistanceAndDirOfVect\Fp minus\Tt to\DFp and\AFu
\DistanceAndDirOfVect\F minus\Tt to\DF and\AF
\SegmentCenter(\F)(\Fp)to\CE \Pbox(\CE)[b]{C}[1.5pt]