From c5aef0f08e1dc8f5fab3d1a598012a93bd76dedd Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 22 Nov 2019 22:19:31 +0000 Subject: pst-eucl (22nov19) git-svn-id: svn://tug.org/texlive/trunk@52891 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-eucl/Changes | 14 + .../doc/generic/pst-eucl/pst-eucl-doc.pdf | Bin 1341324 -> 1688997 bytes .../doc/generic/pst-eucl/pst-eucl-doc.tex | 473 ++++++++++++++++++++- 3 files changed, 474 insertions(+), 13 deletions(-) (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/generic/pst-eucl/Changes b/Master/texmf-dist/doc/generic/pst-eucl/Changes index 585f6936d30..eb8fab448ec 100644 --- a/Master/texmf-dist/doc/generic/pst-eucl/Changes +++ b/Master/texmf-dist/doc/generic/pst-eucl/Changes @@ -1,9 +1,23 @@ pst-eucl.pro -------- +1.02 2019/11/21 - add DeterminantTwo,DeterminantThree,DeterminantFour,DeterminantFive. 1.01 2012/09/21 - fix for introduced bug 1.00 2011/08/05 - fix bug in /InterLines pst-eucl.tex -------- +1.68 2019/11/21 - add macros to construct a triangle by SSS, SAS, ASA, AAS, \pstTriangleSSS, \pstTriangleSAS, etc. + - add macro to get the bisector node of angle AOB, \pstBisectorAOB, refer to pstBissectBAC, pstOutBissectBAC. + - add macro to get the Golden Mean node of a given segment, \pstGoldenMean. + - add macro to define an ellipse by its focus(F) and directrix line(l) and eccentricity(e), \pstGeneralEllipseFle. + - add macro to define an ellipse by quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralEllipseCoef. + - add macro to define an ellipse by given five points, \pstGeneralEllipseABCDE. + - add macro to define an parabola by its focus(F) and directrix line(l), \pstGeneralParabolaFl. + - add macro to define an parabola by quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralParabolaCoef. + - add macro to define an parabola by given five points, \pstGeneralParabolaABCDE. + - add macro to define an hyperbola by its focus(F) and directrix line(l) and eccentricity(e), \pstGeneralHyperbolaFle. + - add macro to define an hyperbola by quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralHyperbolaCoef. + - add macro to define an hyperbola by given five points, \pstGeneralHyperbolaABCDE. + - add macro to draw the line Ax+By+C=0, \pstLineCoef. 1.67 2019/10/28 - add macros to add/subtract/divide the length of two segment, \pstDistAdd, \pstDistSub, and \pstDistDiv etc. - add macros to reduce or enlarge the distance, \pstDistMul, \pstDistCoef. - add macro to get the distance from point C to line AB, \pstDistABC. diff --git a/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.pdf b/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.pdf index 1766af0c738..703c91b79ee 100644 Binary files a/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.pdf and b/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.pdf differ diff --git a/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.tex b/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.tex index dc97768b52d..b9000b9750e 100644 --- a/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-eucl/pst-eucl-doc.tex @@ -6,7 +6,7 @@ \usepackage{multicol} \usepackage{ntheorem} \newtheorem{theorem}{Theorem} -\usepackage{pst-plot,paralist} +\usepackage{pst-func,pst-plot,paralist} \usepackage[mathscr]{eucal} \lstset{pos=l,wide=false,language=PSTricks, morekeywords={multidipole,parallel},basicstyle=\footnotesize\ttfamily} @@ -403,6 +403,53 @@ for each points: \Lkeyword{PointSymbolA}, \Lkeyword{PointSymbolB} and \Lkeyword{PointSymbol}. The management of the default value followed the same rule. +The macros \Lcs{pstTriangleSSS}, \Lcs{pstTriangleSAS}, \Lcs{pstTriangleAAS} and +\Lcs{pstTriangleASA} are used to draw the triangle according the specified sides +or angles. + +\begin{BDef} +\Lcs{pstTriangleSSS}\OptArgs\Largr{pos}\Largb{A}\Largr{a,b,c}\Largb{B}\Largb{C}\\ +\Lcs{pstTriangleSAS}\OptArgs\Largr{pos}\Largb{A}\Largr{b,$\angle{A}$,c}\Largb{B}\Largb{C}\\ +\Lcs{pstTriangleAAS}\OptArgs\Largr{pos}\Largb{A}\Largr{$\angle{C}$,$\angle{A}$,c}\Largb{B}\Largb{C}\\ +\Lcs{pstTriangleASA}\OptArgs\Largr{pos}\Largb{A}\Largr{$\angle{A}$,c,$\angle{B}$}\Largb{B}\Largb{C} +\end{BDef} + +- Macro \Lcs{pstTriangleSSS} create a triangle $ABC$ with given $A(x_1,y_1)$, and the three sides $a,b,c$, +it output $B(x_2,y_2)$ and $C(x_3,y_3)$.\\ +- Macro \Lcs{pstTriangleSAS} create a triangle $ABC$ with given $A(x_1,y_1)$, the angle of $\angle{A}$, and the other two sides $b,c$, +it output $B(x_2,y_2)$ and $C(x_3,y_3)$.\\ +- Macro \Lcs{pstTriangleAAS} create a triangle $ABC$ with given $A(x_1,y_1)$, the angle of $\angle{C}$, the angle of $\angle{A}$, and the side of $AB=c$, +it output $B(x_2,y_2)$ and $C(x_3,y_3)$.\\ +- Macro \Lcs{pstTriangleASA} create a triangle $ABC$ with given $A(x_1,y_1)$, the angle of $\angle{A}$, the angle of $\angle{B}$, and the side of $AB=c$, +it output $B(x_2,y_2)$ and $C(x_3,y_3)$. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](0,0)(4,4) +\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize +\pstGeonode[PosAngle=-90](0,1){A} +\pstTriangleSSS[linecolor=red!60,PosAngle={-90,90}]{A}(3,4,5){B}{C} +\pstTriangleSSS[linecolor=blue!60,PosAngle={-90,90}]{A}(2,4.5,3.8){D}{E} +\pstTriangleSAS[linecolor=green!60,PosAngle={-90,90}]{A}(3,40,2.8){F}{G} +\pstTriangleAAS[linecolor=black!60,PosAngle={-90,90}]{A}(40,50,1.8){H}{I} +\pstTriangleASA[linecolor=purple!60,PosAngle={-90,90}]{A}(70,1.0,60){J}{K} +\end{pspicture} +\end{LTXexample} + +The optional parameter \texttt{pos} setup the position of the first node $A$, it should be 'L' for left, 'R' for right, 'U' for up and 'D' for down. +If you don't input this parameter, the default value is 'L'. The following example explains how to draw an isoceles triangle with the given isoceles sides +and the vertex angle. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](0,0)(4,4) +\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize +\pstGeonode[PosAngle=205](2,2){A} +\pstTriangleSAS[linecolor=red!60,PosAngle={-90,90}]{A}(2,40,2){B}{C} +\pstTriangleSAS[linecolor=blue!60,PosAngle={-90,-90}](U){A}(2,40,2){B}{C} +\pstTriangleSAS[linecolor=purple!60,PosAngle={90,90}](D){A}(2,40,2){B}{C} +\pstTriangleSAS[linecolor=green!60,PosAngle={90,-90}](R){A}(2,40,2){B}{C} +\end{pspicture} +\end{LTXexample} + The macros \Lcs{pstTriangleIC} and \Lcs{pstTriangleOC} are used to draw the inner circle and outer circle of triangle $ABC$. @@ -612,6 +659,26 @@ Here are some examples: \vspace{10pt} +The macros \Lcs{pstLineCoef} is used to draw a line $ax+by+c=0$ with the given coefficents $a,b,c$, +and create two new node $A,B$ on the line. + +\begin{BDef} +\Lcs{pstLineCoef}\OptArgs\Largb{a,b,c}\Largb{A}\Largb{B} +\end{BDef} + +Here are some examples: + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-2,-2)(2,2) +\pstLineCoef[linecolor=red!60, PosAngle={210,0}]{3,-2,1}{A}{B} +\pstLineCoef[linecolor=blue!60, PosAngle={180,0}]{4,3,2}{C}{D} +\pstLineCoef[linecolor=green!60, PosAngle={90,90}]{0,3,-3}{E}{F} +\pstLineCoef[linecolor=purple!60, PosAngle={180,180}]{4,0,4}{G}{H} +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + The macro \Lcs{pstLineAbsNode} creates a new node $C$ whose abscissa is the given value $x_1$ on the line $AB$. The macro \Lcs{pstLineOrdNode} creates a new node $C$ whose ordinate is the given value $y_1$ on the line $AB$. You can input $x_1$ or $y_1$ as any number(e.g, 2.0), @@ -678,6 +745,30 @@ we will introduce \Lcs{pstDistDiv} later. \end{pspicture} \end{LTXexample} +One application of \Lcs{pstProportionNode} is used to find the bisector and out bisector of a given angle. +So we define the macro \Lcs{pstBisectorAOB} to do this work, it is more friendly than the macros +\Lcs{pstBissectBAC} and \Lcs{pstOutBissectBAC}, as it put the new node $T_1$ and $T_2$ on line $AB$, not arc $AB$. + +\begin{BDef} +\Lcs{pstBisectorAOB}\OptArgs\Largb{A}\Largb{O}\Largb{B}\Largb{$T_1$}\Largb{$T_2$} +\end{BDef} + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](0,-1)(5,3) +\psset{unit=0.6cm}\footnotesize\psset{PointSymbol=*} +\pstGeonode[PosAngle=-90](0,0){A} +\pstGeonode[PosAngle=90](3,3){C} +\pstGeonode[PosAngle=-90](2,0){B} +\pstBisectorAOB[PosAngle={-90,-90}]{A}{C}{B}{T_1}{T_2} +\pstLineAB[linecolor=black!50]{A}{C} +\pstLineAB[linecolor=black!50]{B}{C} +\pstLineAB[linecolor=black!50]{A}{B} +\pstLineAB[linestyle=dashed,linecolor=gray]{C}{T_1} +\pstLineAB[linestyle=dashed,linecolor=gray]{C}{T_2} +\pstLineAB[linestyle=dashed,linecolor=gray]{B}{T_2} +\end{pspicture} +\end{LTXexample} + \vspace{10pt} The four collinear points $A,B,C,D$ are called \texttt{Harmonic Conjugation Points} if their cross ratio is $-1$, @@ -838,11 +929,34 @@ of a point on the inversion circle is itself. \vspace{10pt} +If you want to find the node $C$ from $A$ to $B$, such that $C$ is the golden section of the +given segments $AB$, that is, +$$|AC|^2=|AB|\times|BC|\quad\text{or}\quad{}AC:AB=BC:AC\quad\text{or}\quad{}AC=\dfrac{\sqrt{5}-1}{2}AB$$ +you can use the macro \Lcs{pstGoldenMean} to do this work. + +\begin{BDef} +\Lcs{pstGoldenMean}\OptArgs\Largb{A}\Largb{B}\Largb{C} +\end{BDef} + +In fact, we use the macro \Lcs{pstLocateAB} to implement this macro +by passing the value $\dfrac{\sqrt{5}-1}{2}|AB|$ to parameter length. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](0,0)(4,3) +\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize +\pstGeonode[PosAngle=90](0,1){A}(4,2){B} +\pstGoldenMean[PosAngle=90,PointSymbol=o]{A}{B}{C} +\pstLineAB{A}{B} +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + If you want to find the node $C$ from $A$ to $B$, such that $AC$ is the geometric mean of two given segments $DE$ of $FG$, that is, $$|AC|^2=|DE|\times|FG|$$ you can use the macro \Lcs{pstGeometricMean} to do this work. -It also can be used to draw a circle when given two points on the circle, +It also can be used to draw a circle when given two points on the circle, and a line tangents to the circle. \begin{BDef} @@ -1107,15 +1221,15 @@ and the parameter to fill the circle. \psset{unit=0.65cm}\psset{dotscale=0.5}\psset{PointSymbol=*} \pstGeonode[PosAngle=90,CurveType=polyline](0,0){A}(1,0){B} \pstGeonode[PosAngle=90,CurveType=polyline](0,1){A'}(2,1){B'} -\pstCircleOA[linecolor=gray,Radius=\pstDistAdd{A}{B}{A'}{B'}]{A}{} -\pstCircleOA[linecolor=red,Radius=\pstDistAddVal{A}{B}{1.0}{\pstDistConst{0.5}}]{A}{} -\pstCircleOA[linecolor=blue,Radius=\pstDistAddCoef{A}{B}{0.5}{A'}{B'}{1.5}]{A}{} -\pstCircleOA[linecolor=green,Radius=\pstDistSub{A}{B}{A'}{B'}]{B'}{} -\pstCircleOA[linecolor=brown,Radius=\pstDistSubCoef{A}{B}{1.8}{A'}{B'}{0.5}]{A}{} +\pstCircleOA[linecolor=gray,Radius=\pstDistAdd{A}{B}{A'}{B'}]{A}{} % R=|AB|+|A'B'| +\pstCircleOA[linecolor=red,Radius=\pstDistAddVal{A}{B}{1.0}{\pstDistConst{0.5}}]{A}{} % R=|AB|+0.5 +\pstCircleOA[linecolor=blue,Radius=\pstDistAddCoef{A}{B}{0.5}{A'}{B'}{1.5}]{A}{} % R=0.5|AB|+1.5|A'B'| +\pstCircleOA[linecolor=green,Radius=\pstDistSub{A}{B}{A'}{B'}]{B'}{} % R=|AB|-|A'B'| +\pstCircleOA[linecolor=brown,Radius=\pstDistSubCoef{A}{B}{1.8}{A'}{B'}{0.5}]{A}{} R=1.8|AB|-0.5|A'B'| \pnode(-1.5,-2){D} -\pstCircleOA[linecolor=pink,fillstyle=solid,fillcolor=pink!40,Radius=\pstDistMul{A}{B}{0.8}]{D}{} +\pstCircleOA[linecolor=pink,fillstyle=solid,fillcolor=pink!40,Radius=\pstDistMul{A}{B}{0.8}]{D}{} % R=0.8|AB| \psdot(D)\uput{0.2}[-45](D){$D$} -\pstCircleOA[linecolor=purple,Radius=\pstDistConst{\pstAbscissa{D}} abs]{D}{} +\pstCircleOA[linecolor=purple,Radius=\pstDistConst{\pstAbscissa{D}} abs]{D}{} % R=|D.x| \end{pspicture} \end{LTXexample} @@ -1200,8 +1314,8 @@ for example, \pstGeonode[PosAngle=60](1.5,1.5){O} \pstGeonode[PosAngle=-30](2.5,0){A} \pstCircleOA[linecolor=red]{O}{A} -\pstCircleAbsNode[PosAngleA=-60,PosAngleB=60,PointSymbol=*]{O}{A}{1.0}{C}{D} -\pstCircleOrdNode[PosAngleA=150,PosAngleB=30,PointSymbol=*]{O}{A}{1.0}{E}{F} +\pstCircleAbsNode[PosAngle={-60,60},PointSymbol=*]{O}{A}{1.0}{C}{D} +\pstCircleOrdNode[PosAngle={150,30},PointSymbol=*]{O}{A}{1.0}{E}{F} \pstLineAB[linestyle=dashed,linecolor=gray!40,nodesep=-0.5]{C}{D} \pstLineAB[linestyle=dashed,linecolor=gray!40,nodesep=-0.5]{E}{F} \end{pspicture} @@ -1468,6 +1582,25 @@ the macro will draw the whole ellipse. \end{pspicture} \end{LTXexample} +Like as the coordinates, the parameters $a,b$ can be got by the raw PostScript commands too, +where you can use the macros \Lcs{pstDist}*, for example, + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-3,-3)(3,3) +\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize +\pstGeonode[PosAngle=-90,PointSymbol=*](0,0){O}(0,-2.5){R} +\pstCircleOA[linecolor=blue!60]{O}{R} +\pstGeonode[PosAngle=0,PointName=O_1,PointSymbol=*](0,0.8){O1} +\pstGeonode[PosAngle=0,PointName=O_2,PointSymbol=*](0,1.6){O2} +\pstCircleOrdNode[PointName={P,Q},PosAngle={180,0}]{O}{R}{\pstOrdinate{O1}}{P}{Q} +\pstCircleOrdNode[PointName={P',Q'},PosAngle={180,0}]{O}{R}{\pstOrdinate{O2}}{P'}{Q'} +\pstEllipse[linecolor=green!60,linestyle=dashed](O1)(! \pstUserDist{\pstDist{O1}{P}} 0.7)[0][180] +\pstEllipse[linecolor=green!60](O1)(! \pstUserDist{\pstDist{O1}{P}} 0.7)[180][360] +\pstEllipse[linecolor=red!60,linestyle=dashed](O2)(! \pstUserDist{\pstDist{O2}{P'}} 0.5)[0][180] +\pstEllipse[linecolor=red!60](O2)(! \pstUserDist{\pstDist{O2}{P'}} 0.5)[180][360] +\end{pspicture} +\end{LTXexample} + Now you can draw some points on this Ellipse using macro \Lcs{pstEllipseNode} or \Lcs{pstEllipseRotNode}. The macro \Lcs{pstEllipseNode} requires an explicit parameter $t$ as $\alpha$ in equation (\ref{ParametricFunctionOfEllipse}) to calculate the point; but the macro \Lcs{pstEllipseRotNode} requires an implicit parameter \Lkeyword{RotAngle} @@ -1746,7 +1879,120 @@ That is, \Lcs{pstGeneralEllipse} is more complex than \Lcs{pstEllipse}! \end{pspicture} \end{LTXexample} -Similarly, we can location the points on the General Ellipse using the macros +\vspace{10pt} + +The Macro \Lcs{pstGeneralEllipseFle} is used to define a General Ellipse with Focus $F$, directrix line $l$, +and the eccentricity $e$, where $0\le{}e<1$. It just calculate the center $O$, major radius $a$, minor radius $b$ and the rotation +angle $\theta$ of the major axis, then you can pass them into macro \Lcs{pstGeneralEllipse} to draw this ellipse. + +\begin{BDef} +\Lcs{pstGeneralEllipseFle}\OptArgs\Largb{F}\Largb{A}\Largb{B}\Largb{$e$}\Largb{O}\Largb{Rab}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O} is a node name to store the center point, its label and symbol can +be controlled by the options for \PST\ node, such as \Lkeyword{PosAngle}. +The output parameter \texttt{Rab} is a PostScript key to store the pair of major radius and minor radius, +it just use \PST\ node coordinate to store a pair of value, but not a geometrical point. +The output parameter \texttt{$\theta$} is also a PostScript key to store the rotation angle of major axis, +when you pass it to \Lcs{pstGeneralEllipse}, PostScript will lookup the value of this key in current dictionary. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-2,-2)(2,2) +\psset{unit=1.0cm}\psset{dotscale=0.5}\footnotesize +\psset{CodeFig=true,CodeFigColor=gray!50}\psset{PointSymbol=*} +\pstGeonode[PosAngle=30](1,-1){F_1} +\pstGeonode[PosAngle=30](-1,1){F_2} +\pstGeonode[PosAngle=-60](-2,-1){A} +\pstGeonode[PosAngle=-60](2,1){B} +\pstGeneralEllipseFle[PosAngle=30]{F_1}{A}{B}{0.5}{O_1}{R_1}{MajorRotAngle1} +\pstGeneralEllipse[linecolor=red!60](O_1)(R_1)[MajorRotAngle1] +\pstGeneralEllipseFle[PosAngle=30]{F_2}{A}{B}{0.5}{O_2}{R_2}{MajorRotAngle2} +\pstGeneralEllipse[linecolor=blue!60](O_2)(R_2)[MajorRotAngle2] +\pstGeneralEllipseFle[PosAngle=20]{F_1}{A}{B}{0.6}{O_3}{R_3}{MajorRotAngle3} +\pstGeneralEllipse[linecolor=green!60](O_3)(R_3)[MajorRotAngle3] +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +The Macro \Lcs{pstGeneralEllipseCoef} is used to define a General Ellipse by the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$, +it just calculate the center $O$, major radius $a$, minor radius $b$ and the rotation angle $\theta$ of the major axis, +then you can pass them into macro \Lcs{pstGeneralEllipse} to draw this ellipse. +The package \texttt{pst-func} provides macro \Lcs{psplotImp} to draw an implicit defined functions too, +but it can't tell you the geometrical elements like as center or radii, and it will take more time to +calculate the function value point by point. + +\begin{BDef} +\Lcs{pstGeneralEllipseCoef}\OptArgs\Largb{a,b,c,d,e,f}\Largb{O}\Largb{Rab}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O}, the output parameter \texttt{Rab} and the output parameter \texttt{$\theta$} +are same with \Lcs{pstGeneralEllipseFle}. They are set to zero if the coeffients are invalid to construct an ellipse. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-4,-3)(2,3) +\psset{unit=1.0cm}\footnotesize\psset{dotscale=0.5} +\psset{CodeFig=true}\psset{PointSymbol=*} +%2x^2-2xy+3y^2+6x+5y+8=0 +\pstGeneralEllipseCoef[PosAngle=-100,CodeFigColor=red!50]{2,-2,3,6,5,8}{O_1}{R_1}{MajorRotAngle1} +\pstGeneralEllipse[linecolor=red!60](O_1)(R_1)[MajorRotAngle1] +%3x^2-2xy+2y^2-3x+6y+3=0 +\pstGeneralEllipseCoef[PosAngle=-80,CodeFigColor=purple!50]{3,-2,2,-3,5,2}{O_2}{R_2}{MajorRotAngle2} +\pstGeneralEllipse[linecolor=purple!60](O_2)(R_2)[MajorRotAngle2] +%x^2-xy+y^2+x-3y+1=0 +\pstGeneralEllipseCoef[PosAngle=-90,CodeFigColor=green!50]{1,-1,1,1,-3,1}{O_3}{R_3}{MajorRotAngle3} +\pstGeneralEllipse[linecolor=green!60](O_3)(R_3)[MajorRotAngle3] +%2x^2+4xy+3y^2+8x+6y+8=0 +\pstGeneralEllipseCoef[PosAngle=-80,CodeFigColor=blue!50]{2,4,3,8,6,8}{O_4}{R_4}{MajorRotAngle4} +\pstGeneralEllipse[linecolor=blue!60](O_4)(R_4)[MajorRotAngle4] +\end{pspicture} +\end{LTXexample} + +You can verify the output figures with \Lcs{psplotImp} as following: +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-4,-3)(2,3) +\psset{unit=1.0cm}\footnotesize\psset{dotscale=0.5} +%2x^2-2xy+3y^2+6x+5y+8=0 +\psplotImp[linecolor=red!60](-4,-3)(2,3){ 2 x dup mul mul -2 x mul y mul add 3 y dup mul mul add 6 x mul add 5 y mul add 8 add } +%3x^2-2xy+2y^2-3x+6y+3=0 +\psplotImp[linecolor=purple!60](-4,-3)(2,3){ 3 x dup mul mul -2 x mul y mul add 2 y dup mul mul add -3 x mul add 6 y mul add 3 add } +%x^2-xy+y^2+x-3y+1=0 +\psplotImp[linecolor=green!60](-4,-3)(2,3){ 1 x dup mul mul -1 x mul y mul add 1 y dup mul mul add 1 x mul add -3 y mul add 1 add } +%2x^2+4xy+3y^2+8x+6y+8=0 +\psplotImp[linecolor=blue!60](-5,-3)(2,3){ 2 x dup mul mul 4 x mul y mul add 3 y dup mul mul add 8 x mul add 6 y mul add 8 add } +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +The Macro \Lcs{pstGeneralEllipseABCDE} is used to define a General Ellipse by the given five points $A,B,C,D,E$, +it just calculate the center $O$, major radius $a$, minor radius $b$ and the rotation angle $\theta$ of the major axis, +then you can pass them into macro \Lcs{pstGeneralEllipse} to draw this ellipse. + +\begin{BDef} +\Lcs{pstGeneralEllipseABCDE}\OptArgs\Largb{A}\Largb{B}\Largb{C}\Largb{D}\Largb{E}\Largb{O}\Largb{Rab}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O}, the output parameter \texttt{Rab} and the output parameter \texttt{$\theta$} +are same with \Lcs{pstGeneralEllipseFle}. They are set to zero if the points are invalid to construct an ellipse. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-1,-2)(5,4) +\psset{unit=1.0cm}\footnotesize\psset{PointSymbol=*} +\psset{CodeFig=true,CodeFigColor=gray!50} +\pstGeonode[PosAngle=180](0,0){A} +\pstGeonode[PosAngle=-90](2,-1){B} +\pstGeonode[PosAngle=90](3,3){C} +\pstGeonode[PosAngle=-90](4,0){D} +\pstGeonode[PosAngle=0](5,2){E} +\pstGeneralEllipseABCDE[PosAngle=0]{A}{B}{C}{D}{E}{O}{R}{MajorRotAngle} +\pstGeneralEllipse[linecolor=red!60](O)(R)[MajorRotAngle] +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +We can location the points on the General Ellipse using the macros \Lcs{pstGeneralEllipseNode}, \Lcs{pstGeneralEllipseRotNode}, \Lcs{pstGeneralEllipseAbsNode} and \Lcs{pstGeneralEllipseOrdNode} as following. @@ -2212,6 +2458,7 @@ We also use the theorem \ref{ParabolaTangentPointTheorem} to find the tangent no The General Parabola $P$ with coordinate translation and rotation is defined by vertex $O(x_0,y_0)$, the half of the focus chord axis $abs(p)$, the sign of $p$ indicates the direction of the parabola, and the rotation angle $\theta$ of the symmetrical axis. +The symmetrical axis is perpendicular to x-axis when $\theta=0^\circ$, and perpendicular to y-axis when $\theta=90^\circ$. The equation can be got from the parametric function of the parabola equation (\ref{ParametricFunctionOfStandardParabola}), using the rotation transform formula (\ref{RotationTransformFormula}), then we have @@ -2271,6 +2518,111 @@ at most time. \end{pspicture} \end{LTXexample} +\vspace{10pt} + +The Macro \Lcs{pstGeneralParabolaFl} is used to define a General Parabola with Focus $F$, and the directrix line $l$. It just calculate the vertex $O$, half focal chord $p$, and the rotation +angle $\theta$ of the symmetrical axis, then you can pass them into macro \Lcs{pstGeneralParabola} to draw this parabola. + +\begin{BDef} +\Lcs{pstGeneralParabolaFl}\OptArgs\Largb{F}\Largb{A}\Largb{B}\Largb{O}\Largb{p}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O} is a node name to store the vertex point, its label and symbol can +be controlled by the options for \PST\ node, such as \Lkeyword{PosAngle}. +The output parameter \texttt{p} is a PostScript key to store the value of half focal chord. +The output parameter \texttt{$\theta$} is also a PostScript key to store the rotation angle of symmetrical axis, +when you pass it to \Lcs{pstGeneralParabola}, PostScript will lookup the value of this key in current dictionary. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-2,-2)(2,2) +\psset{unit=1.0cm}\psset{dotscale=0.5}\footnotesize +\psset{CodeFig=true,CodeFigColor=gray!50}\psset{PointSymbol=*} +\pstGeonode[PosAngle=-60](1,1){F_1} +\pstGeonode[PosAngle=-60](-1,-1){F_2} +\pstGeonode[PosAngle=60](1,-1){B} +\pstGeonode[PosAngle=60](-1,1){A} +\pstGeneralParabolaFl[PosAngle=60]{F_1}{A}{B}{O_1}{semifocalchordp1}{SymAxisRotAngle1} +\pstGeneralParabola[linecolor=red!60](O_1){semifocalchordp1}[SymAxisRotAngle1]{-2}{2} +\pstGeneralParabolaFl[PosAngle=60]{F_2}{A}{B}{O_2}{semifocalchordp2}{SymAxisRotAngle2} +\pstGeneralParabola[linecolor=blue!60](O_2){semifocalchordp2}[SymAxisRotAngle2]{-2}{2} +\pstGeneralParabolaFl[PosAngle=60]{B}{F_1}{F2}{O_3}{semifocalchordp3}{SymAxisRotAngle3} +\pstGeneralParabola[linecolor=green!60](O_3){semifocalchordp3}[SymAxisRotAngle3]{-2}{2} +\pstGeneralParabolaFl[PosAngle=60]{A}{F_1}{F2}{O_4}{semifocalchordp4}{SymAxisRotAngle4} +\pstGeneralParabola[linecolor=green!60](O_4){semifocalchordp4}[SymAxisRotAngle4]{-2}{2} +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +The Macro \Lcs{pstGeneralParabolaCoef} is used to define a General Parabola by the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$, +it just calculate the vertex $O$, half focal chord $p$ and the rotation angle $\theta$ of the symmetrical axis, +then you can pass them into macro \Lcs{pstGeneralParabola} to draw this parabola. +The package \texttt{pst-func} provides macro \Lcs{psplotImp} to draw an implicit defined functions too, +but it can't tell you the geometrical elements like as center or radii, and it will take more time to +calculate the function value point by point. + +\begin{BDef} +\Lcs{pstGeneralParabolaCoef}\OptArgs\Largb{a,b,c,d,e,f}\Largb{O}\Largb{p}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O}, \texttt{p} and \texttt{$\theta$}are same with \Lcs{pstGeneralParabolaFl}. +They are set to zero if the coeffients are invalid to construct a parabola. +If you pass the zero $p$ into macro \Lcs{pstGeneralParabola}, it will abort with the exception of dividing by zero. + +In the following example, we use \Lcs{psplotImp} to draw the same parabolas, just to check the results +given by macros \Lcs{pstGeneralParabolaCoef} are correct. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-1,-1)(4,4) +\psset{unit=0.40cm}\footnotesize\psset{dotscale=0.5} +\psset{CodeFig=true}\psset{PointSymbol=*} +%x^2-2xy+y^2-8x+16=0 +\psplotImp[linecolor=green!30](-10,-10)(10,10){ 1 x dup mul mul -2 x mul y mul add 1 y dup mul mul add -8 x mul add 0 y mul add 16 add } +\pstGeneralParabolaCoef[PosAngle=0,CodeFigColor=red!50]{1,-2,1,-8,0,16}{O_1}{P1}{SymAxisRotAngle1} +\pstGeneralParabola[linecolor=red!60](O_1){P1}[SymAxisRotAngle1]{-3}{3} +%x^2+2xy+y^2+2x-2y-5=0 +\psplotImp[linecolor=green!30](-10,-10)(10,10){ 1 x dup mul mul 2 x mul y mul add 1 y dup mul mul add 2 x mul add -2 y mul add -5 add } +\pstGeneralParabolaCoef[PosAngle=-90,CodeFigColor=black!60]{1,2,1,2,-2,-5}{O_2}{P2}{SymAxisRotAngle2} +\pstGeneralParabola[linecolor=black!60](O_2){P2}[SymAxisRotAngle2]{-3}{3} +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +The Macro \Lcs{pstGeneralParabolaABCDE} is used to define a General Parabola by the given five points $A,B,C,D,E$, +it just calculate the vertex $O$, half focal chord $p$ and the rotation angle $\theta$ of the symmetrical axis, +then you can pass them into macro \Lcs{pstGeneralParabola} to draw this parabola. + +\begin{BDef} +\Lcs{pstGeneralParabolaABCDE}\OptArgs\Largb{A}\Largb{B}\Largb{C}\Largb{D}\Largb{E}\Largb{O}\Largb{p}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O}, \texttt{p} and \texttt{$\theta$} are same with \Lcs{pstGeneralParabolaFl}. +They are set to zero if the points are invalid to construct a parabola. +If you pass the zero $p$ into macro \Lcs{pstGeneralParabola}, it will abort with the exception of dividing by zero. + +Note the algorithm may fit a hyperbola quadratic curve from the given five points, +in order to get the right parabola curve, you must input the point coordinates very precisely. +In the following example, if you input point $A$ as $(3,1.732)$, it will fail as no such parabola +can fit these five points. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](0,-2)(4,2) +\psset{unit=0.5cm}\footnotesize\psset{PointSymbol=*} +\psset{CodeFig=true,CodeFigColor=gray!50} +% five points from y^2-2x+3=0 +\pstGeonode[PosAngle=90](3,1.73205){A} +\pstGeonode[PosAngle=90](2,1){B} +\pstGeonode[PosAngle=-90](2,-1){C} +\pstGeonode[PosAngle=90](6,3){D} +\pstGeonode[PosAngle=-90](6,-3){E} +\pstGeneralParabolaABCDE[PosAngle=235]{A}{B}{C}{D}{E}{O}{P}{SymAxisRotAngle} +\pstGeneralParabola[linecolor=red!60](O){P}[SymAxisRotAngle]{-3}{3} +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + The macro \Lcs{pstGeneralParabolaFocusNode} is used to find the focus of the parabola, and the macro \Lcs{pstGeneralParabolaDirectrixLine} is used to find the directrix line of the parabola. @@ -2969,6 +3321,101 @@ it should be setup from 0 to 90. \end{pspicture} \end{LTXexample} +\vspace{10pt} + +The Macro \Lcs{pstGeneralHyperbolaFle} is used to define a General Hyperbola with Focus $F$, directrix line $l$, +and the eccentricity $e$, where $e>1$. It just calculate the center $O$, real radius $a$, imaginary radius $b$ and the rotation +angle $\theta$ of the real axis, then you can pass them into macro \Lcs{pstGeneralHyperbola} to draw this hyperbola. + +\begin{BDef} +\Lcs{pstGeneralHyperbolaFle}\OptArgs\Largb{F}\Largb{A}\Largb{B}\Largb{$e$}\Largb{O}\Largb{Rab}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O} is a node name to store the center point, its label and symbol can +be controlled by the options for \PST\ node, such as \Lkeyword{PosAngle}. +The output parameter \texttt{Rab} is a PostScript key to store the pair of real radius and imaginary radius, +it just use \PST\ node coordinate to store a pair of value, but not a geometrical point. +The output parameter \texttt{$\theta$} is also a PostScript key to store the rotation angle of real axis, +when you pass it to \Lcs{pstGeneralHyperbola}, PostScript will lookup the value of this key in current dictionary. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-2,-2)(2,2) +\psset{unit=1.0cm}\psset{dotscale=0.5}\footnotesize +\psset{CodeFig=true,CodeFigColor=gray!50}\psset{PointSymbol=*} +\pstGeonode[PosAngle=-60](1,1){F_1} +\pstGeonode[PosAngle=-60](-1,-1){F_2} +\pstGeonode[PosAngle=-60](1,-1){B} +\pstGeonode[PosAngle=-60](-1,1){A} +\pstGeneralHyperbolaFle[PosAngle=-60]{F_1}{A}{B}{2.4}{O_1}{R_1}{RealAxisRotAngle1} +\pstGeneralHyperbola[linecolor=red!60](O_1)(R_1)[RealAxisRotAngle1][65] +\pstGeneralHyperbolaFle[PosAngle=-60]{F_2}{A}{B}{2.4}{O_2}{R_2}{RealAxisRotAngle2} +\pstGeneralHyperbola[linecolor=blue!60](O_2)(R_2)[RealAxisRotAngle2][65] +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +The Macro \Lcs{pstGeneralHyperbolaCoef} is used to define a General Hyperbola by the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$, +it just calculate the center $O$, real radius $a$ and imaginary radius $b$ and the rotation angle $\theta$ of the real axis, +then you can pass them into macro \Lcs{pstGeneralHyperbola} to draw this hyperbola. +The package \texttt{pst-func} provides macro \Lcs{psplotImp} to draw an implicit defined functions too, +but it can't tell you the geometrical elements like as center or radii, and it will take more time to +calculate the function value point by point. + +\begin{BDef} +\Lcs{pstGeneralHyperbolaCoef}\OptArgs\Largb{a,b,c,d,e,f}\Largb{O}\Largb{Rab}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O}, the output parameter \texttt{Rab} and the output parameter \texttt{$\theta$}~ +are same with \Lcs{pstGeneralHyperbolaFle}. They are set to zero if the coeffients are invalid to construct a hyperbola. + +In the following example, we use \Lcs{psplotImp} to draw the same hyperbolas, just to check the results +given by macros \Lcs{pstGeneralHyperbolaCoef} are correct. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-4,-4)(4,4) +\psset{unit=0.40cm}\footnotesize\psset{dotscale=0.5} +\psset{CodeFig=true}\psset{PointSymbol=*} +%x^2+3xy-2y^2+10x-5y+6=0 +\psplotImp[linecolor=green!30](-10,-10)(10,10){ 1 x dup mul mul 3 x mul y mul add -2 y dup mul mul add 10 x mul add -5 y mul add 6 add } +\pstGeneralHyperbolaCoef[PosAngle=-30,CodeFigColor=red]{1,3,-2,10,-5,6}{O_1}{R_1}{RealAxisRotAngle1} +\pstGeneralHyperbola[linecolor=red](O_1)(R_1)[RealAxisRotAngle1][60] +%x^2-3xy+y^2+10x-10y+21=0 +\psplotImp[linecolor=blue!30](-10,-10)(10,10){ 1 x dup mul mul -3 x mul y mul add 1 y dup mul mul add 10 x mul add -10 y mul add 21 add } +\pstGeneralHyperbolaCoef[PosAngle=-10,CodeFigColor=black]{1,-3,1,10,-10,21}{O_2}{R_2}{RealAxisRotAngle2} +\pstGeneralHyperbola[linecolor=black](O_2)(R_2)[RealAxisRotAngle2][60] +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + +The Macro \Lcs{pstGeneralHyperbolaABCDE} is used to define a General Hyperbola by the given five points $A,B,C,D,E$, +it just calculate the center $O$, real radius $a$ and imaginary radius $b$ and the rotation angle $\theta$ of the real axis, +then you can pass them into macro \Lcs{pstGeneralHyperbola} to draw this hyperbola. + +\begin{BDef} +\Lcs{pstGeneralHyperbolaABCDE}\OptArgs\Largb{A}\Largb{B}\Largb{C}\Largb{D}\Largb{E}\Largb{O}\Largb{Rab}\Largb{$\theta$} +\end{BDef} + +The output parameter \texttt{O}, the output parameter \texttt{Rab} and the output parameter \texttt{$\theta$}~ +are same with \Lcs{pstGeneralHyperbolaFle}. They are set to zero if the points are invalid to construct a hyperbola. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-1,-3)(4,2) +\psset{unit=0.5cm}\footnotesize\psset{PointSymbol=*} +\psset{CodeFig=true,CodeFigColor=gray!50} +\pstGeonode[PosAngle=180](0,0){A} +\pstGeonode[PosAngle=-90](2,-1){B} +\pstGeonode[PosAngle=-90](3,-3){C} +\pstGeonode[PosAngle=-90](4,0){D} +\pstGeonode[PosAngle=0](5,2){E} +\pstGeneralHyperbolaABCDE[PosAngle=0]{A}{B}{C}{D}{E}{O}{R}{RealAxisRotAngle} +\pstGeneralHyperbola[linecolor=red!60](O)(R)[RealAxisRotAngle][80] +\end{pspicture} +\end{LTXexample} + +\vspace{10pt} + The macro \Lcs{pstGeneralHyperbolaNode} is used to draw a node whose parameter is the given value $t$ on General Hyperbola, please refer to equation (\ref{ParametricFunctionOfGeneralHyperbola}). The macro \Lcs{pstGeneralHyperbolaAbsNode} is used to draw the nodes whose abscissa are the given value $x_1$ on General Hyperbola. @@ -4613,7 +5060,7 @@ set of all the mediator lines of segments defined by $A$ and the circle points, create two conics depending of the position of $A$: \begin{compactitem} -\item inside the circle: an hyperbola; +\item inside the circle: a hyperbola; \item outside the circle: an ellipse. \end{compactitem} -- cgit v1.2.3