summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pstricks/contrib')
-rw-r--r--graphics/pstricks/contrib/pst-eucl/Changes15
-rw-r--r--graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.bib19
-rw-r--r--graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.pdfbin1568670 -> 1779040 bytes
-rw-r--r--graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.tex322
-rw-r--r--graphics/pstricks/contrib/pst-eucl/dvips/pst-eucl.pro892
-rw-r--r--graphics/pstricks/contrib/pst-eucl/latex/pst-eucl.sty4
-rw-r--r--graphics/pstricks/contrib/pst-eucl/tex/pst-eucl.tex1845
7 files changed, 2632 insertions, 465 deletions
diff --git a/graphics/pstricks/contrib/pst-eucl/Changes b/graphics/pstricks/contrib/pst-eucl/Changes
index a80eb43537..a532ffec14 100644
--- a/graphics/pstricks/contrib/pst-eucl/Changes
+++ b/graphics/pstricks/contrib/pst-eucl/Changes
@@ -1,4 +1,5 @@
pst-eucl.pro --------
+1.04 2020/09/29 - some new functions for 1.75
1.03 2020/01/09 - some new functions for 1.69
1.02 2019/11/21 - add DeterminantTwo,DeterminantThree,DeterminantFour,DeterminantFive.
1.01 2012/09/21 - fix for introduced bug
@@ -6,6 +7,20 @@ pst-eucl.pro --------
pst-eucl.tex --------
+1.75 2020/09/29 - add macro to calc the coefficents of general conic $ax^2+bxy+cy^2+dx+ey+f=0$ through given five points, \pstGeneralConicEquation.
+ - add macro to calc the coefficents of general conic $ax^2+bxy+cy^2+dx+ey+f=0$ of the given ellipse, \pstGeneralEllipseEquation.
+ - add macro to calc the coefficents of general conic $ax^2+bxy+cy^2+dx+ey+f=0$ of the given hyperbola, \pstGeneralHyperbolaEquation.
+ - add macro to calc the coefficents of general conic $ax^2+bxy+cy^2+dx+ey+f=0$ of the given parabola, \pstGeneralParabolaEquation.
+ - add macro to draw the intersections of line AB and general conic $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralConicLineInter.
+ - add macro to draw the intersections of circle OA and general conic $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralConicCircleInter.
+ - add macro to draw the intersections of ellipse and general conic $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralConicEllipseInter.
+ - add macro to draw the intersections of hyperbola and general conic $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralConicHyperbolaInter.
+ - add macro to draw the intersections of parabola and general conic $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralConicParabolaInter.
+ - add macro to draw the intersections of two general conics $ax^2+bxy+cy^2+dx+ey+f=0$, \pstGeneralConicInter.
+ - fix an issue in \pstGeneralHyperbolaCoef that it gets the wrong symmetrical axis when draw quadratic curve 2xy-x+2y+1=0.
+ - update \pstGeneralHyperbolaABCDE to support the quadratic curve equation with a=0, e.g, given five points from curve xy=1.
+ - update the (pos) parameter U|D|L|R to :U|:D|:L|:R in \pstTriangleSSS, \pstTriangleSAS etc,
+ and support (node) to specify a base line to draw the triangle.
1.74 2020/07/15 - add macro to draw the equilateral triangle on a given side AB, \pstETriangleAB.
- add macro to draw the square on a given side AB, \pstSquareAB.
- add macro to draw the regular polygon on a given side AB, \pstRegularPolygonAB.
diff --git a/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.bib b/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.bib
index f1d5a1b2ed..7e9f03b000 100644
--- a/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.bib
+++ b/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.bib
@@ -41,17 +41,17 @@
@ctan{multido,
title = {The Multido package},
-subtitle = {A loop facility for Generic \TeX},
+subtitle = {A loop facility for Generic TeX},
author = {Van Zandt, Timothy and Voß, Herbert and Niepraschk, Rolf},
url = {macros/latex/multido},
urldate = {2018-09-01},
-version = {1.42},
+version = {1.42}
}
@Book{PSTricks2,
author = {Herbert Voß},
- title = {\texttt{PSTricks} -- {G}rafik für \TeX{} und \LaTeX},
+ title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX},
edition = {7},
publisher = {DANTE {\eV} and Lehmanns Media},
date = {2016},
@@ -88,7 +88,7 @@ version = {1.42},
@Book{tbt,
author = {Victor Eijkhout},
- title = {\TeX\ by Topic -- A \TeX{}nician Reference},
+ title = {\TeX\ by Topic -- {A} \TeX{}nician Reference},
edition = {1},
publisher = {DANTE {\eV} and Lehmanns Media},
year = {2014},
@@ -99,7 +99,7 @@ version = {1.42},
@Article{dtk02.1:voss:mathematischen,
author = {Herbert Voß},
- title = {Die mathematischen Funktionen von Postscript},
+ title = {Die mathematischen {F}unktionen von {P}ostscript},
journal = dtk,
year = 2002,
volume = {1/02},
@@ -108,5 +108,14 @@ version = {1.42},
month = mar,
pages = {40-47},
annote = bretter,
+ abstract = { \PS, faktisch genauso alt wie {\TeX}, ist im
+ Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es
+ darum geht zu beurteilen, was es denn nun im eigentlichen
+ Sinne ist. Au{\ss}erdem wird h{\"a}ufig vergessen, dass
+ sich mit den \PS-Funktionen viele Dinge erledigen lassen,
+ bei denen sonst auf externe Programme zur{\"u}ckgegriffen
+ wird. Dies wird im Folgenden f{\"u}r die mathematischen
+ Funktionen im Zusammenhang mit dem Paket \texttt{pst-plot}
+ gezeigt. }
}
diff --git a/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.pdf b/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.pdf
index cbb859381e..5f06ffd370 100644
--- a/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.pdf
+++ b/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.tex b/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.tex
index 054dae2eb2..86dbdc3cf7 100644
--- a/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.tex
+++ b/graphics/pstricks/contrib/pst-eucl/doc/pst-eucl-doc.tex
@@ -1,6 +1,5 @@
-\PassOptionsToPackage{style=dtk}{biblatex}
-\documentclass[11pt,english,BCOR10mm,DIV=12,bibliography=totoc,parskip=false,smallheadings,
- headexclude,footexclude,oneside,english]{pst-doc}
+\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
+ headinclude=false,footinclude=false,twoside,english]{pst-doc}
\usepackage{pst-eucl}
\let\pstEuclideFV\fileversion
\usepackage{multicol}
@@ -10,20 +9,20 @@
\usepackage[mathscr]{eucal}
\def\eV{e.\kern-1pt{}V\kern-1pt}
-\lstset{pos=l,wide=false,basicstyle=\footnotesize\ttfamily,explpreset={language=[PSTricks]{TeX}}}
+\lstset{pos=l,wide=false,basicstyle=\footnotesize\ttfamily,frame={},rframe={},explpreset={language=[PSTricks]{TeX}}}
%
\def\Argsans#1{$\langle$#1$\rangle$}
\def\DefaultVal#1{(by default #1)}
+\usepackage{biblatex}
\addbibresource{\jobname.bib}
-\lstset{rframe={}}
-
+\RedeclareSectionCommand[tocnumwidth=3em]{subsection}
\title{\texttt{pst-euclide}}
\subtitle{A PSTricks package for drawing geometric pictures; v.\pstEuclideFV}
-\author{Dominique Rodriguez\\Herbert Voß}
-\docauthor{Herbert Voß}
+\author{Dominique Rodriguez\and Herbert Voß\and Liao Xiongfei}
+\docauthor{Herbert Voß/Liao Xiongfei}
\date{\today}
\begin{document}
\maketitle
@@ -57,8 +56,8 @@
\noindent
Thanks to:
Manuel Luque;
-Thomas Söll;
-Liao Xiongfei.
+Thomas Söll.
+
@@ -354,8 +353,8 @@ the rule bar and the segment.
It does not display the ruler bar as default, and you need to setup \Lkeyword{linestyle}
to display it. The star version uses also the star version of the put macro (white background).
-\begin{LTXexample}[pos=t]
-\begin{pspicture}[showgrid=true](-2,-2)(5,5)
+\begin{LTXexample}[width=6cm,pos=l]
+\begin{pspicture}[showgrid=true](-1,-1)(4,4)
\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize
\pstGeonode[PosAngle=-90](0.5,1.5){A}
\pstGeonode[PosAngle=-90](2.5,1.5){B}\pstLineAB{A}{B}
@@ -441,18 +440,20 @@ it output $B(x_2,y_2)$ and $C(x_3,y_3)$.
\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
+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.
+You also can specify one another node $X$ to draw a triangle base on the line $AX$. 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}
+\pstGeonode[PosAngle={205,90}](2,2){A}(4,0){X}
+\pstTriangleSAS[linecolor=red!60,PosAngle={0,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}
+\pstTriangleSAS[linecolor=brown!60,PosAngle={-120,-60}](X){A}(2,40,2){B}{C}
\end{pspicture}
\end{LTXexample}
@@ -490,7 +491,7 @@ For example:
\end{lstlisting}
The macros \Lcs{pstTriangleGC}, \Lcs{pstTriangleHC}, \Lcs{pstTriangleEC}, \Lcs{pstTriangleNC}, \Lcs{pstTriangleLC}
-are used to draw the barycenter $G$, the orthocentre $H$, the escenter $E$, the nine points circle center
+are used to draw the barycenter $G$, the orthocentre $H$, the escenter $E$, the nine points circle center
and the Lemonie point (or symmedian point) of the triangle $ABC$.
\begin{BDef}
@@ -1029,7 +1030,7 @@ The length $L_1$ and $L_2$ can be got from \Lcs{pstDist}, \Lcs{pstDistConst},
\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize
\pstGeonode[PosAngle=90](0,1){A}
\pstGeonode[PosAngle=0](3.2,2){C}(3.2,1){D}(3.2,-2){E}
-\pstGeometricMean[PosAngle=90]{C}{A}{\pstDistAB{C}{D}}{\pstDistAB{D}{E}}{B}
+\pstGeometricMean[PosAngle=90]{C}{A}{\pstDistAB{C}{D}}{\pstDistAB{C}{E}}{B}
\pstCircleABC[linecolor=gray!60]{B}{D}{E}{O}
\pstLineAB[linecolor=red!40]{C}{D}
\pstLineAB[linecolor=blue!40]{D}{E}
@@ -1633,11 +1634,11 @@ The macro \Lcs{pstRegularPolygonAB} draw a n-side regular polygon on a given sid
The macro \Lcs{pstRegularPolygonOA} draw a n-side regular polygon with center $O$ and base point $A_0$, and output the other nodes $A_1,A_2,\cdots,A_{n-1}$.
You can use the parameters \Lkeyword{linestyle}, \Lkeyword{linecolor}, \Lkeyword{linewidth}
-to control the line style; and use the parameters \Lkeyword{PointName}, \Lkeyword{PosAngle},
+to control the line style; and use the parameters \Lkeyword{PointName}, \Lkeyword{PosAngle},
\Lkeyword{PointSymbol} to control the point nodes; and use the parameters \Lkeyword{CurveType},
-\Lkeyword{fillstyle}, \Lkeyword{fillcolor} to control the polygon style.
+\Lkeyword{fillstyle}, \Lkeyword{fillcolor} to control the polygon style.
-For the last output point list in macro \Lcs{pstRegularPolygonAB} and \Lcs{pstRegularPolygonOA}, if you do not enter a complete point list,
+For the last output point list in macro \Lcs{pstRegularPolygonAB} and \Lcs{pstRegularPolygonOA}, if you do not enter a complete point list,
the remaining points will be automatically named.
Note that draw regular polygon with side from $A$ to $B$ and side from $B$ to $A$ will get the figure symmetric to $AB$.
@@ -1647,10 +1648,10 @@ Here are some examples.
\begin{pspicture}[showgrid](-1,-2)(3,2)
\psset{unit=0.40cm}\footnotesize\psset{PointSymbol=none,PointNameSep=0.22cm}
\pstGeonode[PosAngle={180,0},PointSymbol=*](0,0){A}(5,0){B}
-\pstETriangleAB[linecolor=red!60,PosAngle=90,PointSymbol=*]{A}{B}{C}
-\pstETriangleAB[linecolor=blue!60,PosAngle=-90,PointSymbol=*,fillstyle=solid,fillcolor=blue!20]{B}{A}{C'}
\pstSquareAB[linecolor=red!60,PosAngle={90,90},PointSymbol=*]{A}{B}{C}{D}
\pstSquareAB[linecolor=blue!60,PosAngle={-90,-90},PointSymbol=*,fillstyle=solid,fillcolor=blue!20,opacity=0.2]{B}{A}{C'}{D'}
+\pstETriangleAB[linecolor=red!60,PosAngle=90,PointSymbol=*]{A}{B}{C}
+\pstETriangleAB[linecolor=blue!60,PosAngle=-90,PointSymbol=*,fillstyle=solid,fillcolor=blue!20]{B}{A}{C'}
\end{pspicture}
\end{LTXexample}
@@ -2182,7 +2183,7 @@ are same with \Lcs{pstGeneralEllipseFle}. They are set to zero if the points are
\begin{LTXexample}[width=6cm,pos=l]
\begin{pspicture}[showgrid=true](-1,-2)(5,4)
-\psset{unit=1.0cm}\footnotesize\psset{PointSymbol=*}
+\psset{unit=0.8cm}\footnotesize\psset{PointSymbol=*}
\psset{CodeFig=true,CodeFigColor=gray!50}
\pstGeonode[PosAngle=180](0,0){A}
\pstGeonode[PosAngle=-90](2,-1){B}
@@ -2490,23 +2491,23 @@ then $TA$ is the tangent line through $A$ and $TB$ is the tangent line through $
\end{pspicture}
\end{LTXexample}
-\subsection{Standard Inversion Parabola}
-The Inversion Parabola $P$ with coordinate translation is defined by vertex $O(x_0,y_0)$,
+\subsection{Standard Conjugate Parabola}
+The Conjugate Parabola $P$ with coordinate translation is defined by vertex $O(x_0,y_0)$,
the half of the focus chord axis $abs(p)$.
Note that the sign of $p$ indicates the direction of the parabola.
The equation can be written as:
-\begin{equation}\label{StandardInversionParabola}
+\begin{equation}\label{StandardConjugateParabola}
(y-y_0)^2=2p(x-x_0)
\end{equation}
and the parametric function can be written as:
-\begin{equation}\label{ParametricFunctionOfStandardInversionParabola}
+\begin{equation}\label{ParametricFunctionOfStandardConjugateParabola}
\left\{\begin{array}{l}
x=\dfrac{t^2}{2p}+x_0\\
y=t+y_0
\end{array}\right.
\end{equation}
-The macro \Lcs{pstIParabola} is used to draw a Standard Inversion Parabola from $y_1$ to $y_2$ with Vertex $O$,
+The macro \Lcs{pstIParabola} is used to draw a Standard Conjugate Parabola from $y_1$ to $y_2$ with Vertex $O$,
the half of the focus chord axis $abs(p)$.
\begin{BDef}
@@ -2514,7 +2515,7 @@ the half of the focus chord axis $abs(p)$.
\end{BDef}
The macro \Lcs{pstIParabolaNode} is used to draw a node whose parameter is the given value $t$ on parabola,
-please refer to equation (\ref{ParametricFunctionOfStandardInversionParabola}).
+please refer to equation (\ref{ParametricFunctionOfStandardConjugateParabola}).
The macro \Lcs{pstIParabolaAbsNode} is used to draw a node whose abscissa is the given value $x_1$ on parabola.
The macro \Lcs{pstIParabolaOrdNode} is used to draw a node whose ordinate is the given value $y_1$ on parabola.
Note that \Lcs{pstIParabolaAbsNode} will create two nodes $A$ and $B$ at most time.
@@ -2889,7 +2890,7 @@ Here is the intersections of a real General Parabola with any kind of lines:
\end{pspicture}
\end{LTXexample}
-When General Parabola becomes a Standard Inversion Parabola, the intersections with any kind of lines:
+When General Parabola becomes a Standard Conjugate Parabola, the intersections with any kind of lines:
\begin{LTXexample}[width=6cm,pos=l]
\begin{pspicture}[showgrid=true](-1,-2)(3,2)
\psset{dotscale=0.5}\psset{PointSymbol=*}\footnotesize
@@ -2954,12 +2955,12 @@ We also use the theorem \ref{ParabolaTangentPointTheorem} to find the tangent no
\end{pspicture}
\end{LTXexample}
-\subsection{General Inversion Parabola}
-The General Inversion Parabola $P$ with coordinate translation and rotation is defined by vertex $O$,
+\subsection{General Conjugate Parabola}
+The General Conjugate Parabola $P$ with coordinate translation and rotation is defined by vertex $O$,
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 equation can be got from the parametric function of the inversion parabola (\ref{ParametricFunctionOfStandardInversionParabola}),
+The equation can be got from the parametric function of the conjugate parabola (\ref{ParametricFunctionOfStandardConjugateParabola}),
using the rotation transform formula (\ref{RotationTransformFormula}), then we have
\begin{equation}
\left\{\begin{array}{l}
@@ -2968,15 +2969,15 @@ y'=(\dfrac{t^2}{2p}+x_0)\sin\theta+(t+y_0)\cos\theta=y_0'+t\cos\theta+t^2\dfrac{
\end{array}\right.
\end{equation}
where the $x_0'$ and $y_0'$ are the coordinate of the given vertex O after rotation.
-So we get the parametric function of the General Inversion Parabola with coordinate translation and rotation as following:
-\begin{equation}\label{ParametricFunctionOfGeneralInversionParabola}
+So we get the parametric function of the General Conjugate Parabola with coordinate translation and rotation as following:
+\begin{equation}\label{ParametricFunctionOfGeneralConjugateParabola}
\left\{\begin{array}{l}
x=x_0-t\sin\theta+t^2\dfrac{\cos\theta}{2p}\\
y=y_0+t\cos\theta+t^2\dfrac{\sin\theta}{2p}
\end{array}\right.
\end{equation}
-The macro \Lcs{pstGeneralIParabola} is used to draw a Standard Inversion Parabola from $y_1$ to $y_2$ with Vertex $O$,
+The macro \Lcs{pstGeneralIParabola} is used to draw a Standard Conjugate Parabola from $y_1$ to $y_2$ with Vertex $O$,
the half of the focus chord axis $abs(p)$.
\begin{BDef}
@@ -2984,7 +2985,7 @@ the half of the focus chord axis $abs(p)$.
\end{BDef}
The macro \Lcs{pstGeneralIParabolaNode} is used to draw a node whose parameter is the given value $t$ on parabola,
-please refer to equation (\ref{ParametricFunctionOfGeneralInversionParabola}).
+please refer to equation (\ref{ParametricFunctionOfGeneralConjugateParabola}).
The macro \Lcs{pstGeneralIParabolaAbsNode} is used to draw a node whose abscissa is the given value $x_1$ on parabola.
The macro \Lcs{pstGeneralIParabolaOrdNode} is used to draw a node whose ordinate is the given value $y_1$ on parabola.
@@ -3327,22 +3328,22 @@ $RQ$ and $PS$ intersect at $Y$, then the intersection points $A$ and $B$ of $XY$
\end{pspicture}
\end{LTXexample}
-\subsection{Standard Inversion Hyperbola}
-The Standard Inversion Hyperbola $H$ with coordinate translation is defined by center $O$,
+\subsection{Standard Conjugate Hyperbola}
+The Standard Conjugate Hyperbola $H$ with coordinate translation is defined by center $O$,
the half of the real axis $a$, the half of the imaginary axis $b$.
The equation can be written as:
-\begin{equation}\label{FunctionOfStandardInversionHyperbola}
+\begin{equation}\label{FunctionOfStandardConjugateHyperbola}
\dfrac{(y-y_0)^2}{a^2}-\dfrac{(x-x_0)^2}{b^2}=1
\end{equation}
and the parametric function can be written as:
-\begin{equation}\label{ParametricFunctionOfStandardInversionHyperbola}
+\begin{equation}\label{ParametricFunctionOfStandardConjugateHyperbola}
\left\{\begin{array}{l}
x=b\tan\alpha+x_0\\
y=a\sec\alpha+y_0
\end{array}\right.
\end{equation}
-The macro \Lcs{pstIHyperbola} is used to draw a Standard Inversion Hyperbola with Center $O$,
+The macro \Lcs{pstIHyperbola} is used to draw a Standard Conjugate Hyperbola with Center $O$,
the half of the real axis $a$, the half of the imaginary axis $b$.
The parameter \texttt{angleY} is used to truncate the height of the figure,
it should be setup from 0 to 90.
@@ -3351,10 +3352,10 @@ it should be setup from 0 to 90.
\Lcs{pstIHyperbola}\OptArgs\Largr{O}\Largr{$a,\,b$}\OptArg{angleY}
\end{BDef}
-The macro \Lcs{pstIHyperbolaNode} is used to draw a node whose parameter is the given value $t$ on Inversion Hyperbola,
-please refer to equation (\ref{ParametricFunctionOfStandardInversionHyperbola}).
-The macro \Lcs{pstIHyperbolaAbsNode} is used to draw the nodes whose abscissa are the given value $x_1$ on Inversion Hyperbola.
-The macro \Lcs{pstIHyperbolaOrdNode} is used to draw the nodes whose ordinate are the given value $y_1$ on Inversion Hyperbola.
+The macro \Lcs{pstIHyperbolaNode} is used to draw a node whose parameter is the given value $t$ on Conjugate Hyperbola,
+please refer to equation (\ref{ParametricFunctionOfStandardConjugateHyperbola}).
+The macro \Lcs{pstIHyperbolaAbsNode} is used to draw the nodes whose abscissa are the given value $x_1$ on Conjugate Hyperbola.
+The macro \Lcs{pstIHyperbolaOrdNode} is used to draw the nodes whose ordinate are the given value $y_1$ on Conjugate Hyperbola.
Note that \Lcs{pstIHyperbolaAbsNode} and \Lcs{pstIHyperbolaOrdNode} will create two nodes $A$ and $B$ at most time.
@@ -3380,8 +3381,8 @@ Note that \Lcs{pstIHyperbolaAbsNode} and \Lcs{pstIHyperbolaOrdNode} will create
\end{pspicture}
\end{LTXexample}
-The macro \Lcs{pstIHyperbolaFocusNode} is used to find the focus nodes of the Inversion Hyperbola,
-and the macro \Lcs{pstIHyperbolaDirectrixLine} is used to find the directrix lines of the Inversion Hyperbola.
+The macro \Lcs{pstIHyperbolaFocusNode} is used to find the focus nodes of the Conjugate Hyperbola,
+and the macro \Lcs{pstIHyperbolaDirectrixLine} is used to find the directrix lines of the Conjugate Hyperbola.
\begin{BDef}
\Lcs{pstIHyperbolaFocusNode}\OptArgs\Largr{O}\Largr{$a,\,b$}\Largb{$F_1$}\Largb{$F_2$}\\
@@ -3784,11 +3785,11 @@ We also use the theorem \ref{HyperbolaTangentPointTheorem} to find the tangent p
\end{pspicture}
\end{LTXexample}
-\subsection{General Inversion Hyperbola}
-The General Inversion Hyperbola $H$ with coordinate translation and rotation is defined by center $O$,
+\subsection{General Conjugate Hyperbola}
+The General Conjugate Hyperbola $H$ with coordinate translation and rotation is defined by center $O$,
the half of the real axis $a$, the half of the imaginary axis $b$,
and the rotation angle $\theta$ of the principal axis.
-The equation can be got from the parametric function of the Standard Inversion Hyperbola equation (\ref{ParametricFunctionOfStandardInversionHyperbola}),
+The equation can be got from the parametric function of the Standard Conjugate Hyperbola equation (\ref{ParametricFunctionOfStandardConjugateHyperbola}),
using the rotation transform formula (\ref{RotationTransformFormula}), then we have
\begin{equation}
\left\{\begin{array}{l}
@@ -3797,15 +3798,15 @@ y'=(b\tan\alpha+x_0)\sin\theta+(a\sec\alpha+y_0)\cos\theta=y_0'+b\tan\alpha\sin\
\end{array}\right.
\end{equation}
where the $x_0'$ and $y_0'$ are the coordinate of the given center $O$ after rotation.
-So we get the parametric function of the General Inversion Hyperbola with coordinate translation and rotation as following:
-\begin{equation}\label{ParametricFunctionOfGeneralInversionHyperbola}
+So we get the parametric function of the General Conjugate Hyperbola with coordinate translation and rotation as following:
+\begin{equation}\label{ParametricFunctionOfGeneralConjugateHyperbola}
\left\{\begin{array}{l}
x=x_0+b\tan\alpha\cos\theta-a\sec\alpha\sin\theta\\
y=y_0+b\tan\alpha\sin\theta+a\sec\alpha\cos\theta
\end{array}\right.
\end{equation}
-The macro \Lcs{pstGeneralIHyperbola} is used to draw a General Inversion Hyperbola with Center $O$,
+The macro \Lcs{pstGeneralIHyperbola} is used to draw a General Conjugate Hyperbola with Center $O$,
the half of the real axis $a$, the half of the imaginary axis $b$,
and the rotation angle $\theta$ of the symmetrical axis.
The parameter \texttt{angleY} is used to truncate the height of the figure,
@@ -3831,11 +3832,11 @@ it should be setup from 0 to 90.
\end{pspicture}
\end{LTXexample}
-The macro \Lcs{pstGeneralIHyperbolaNode} is used to draw a node whose parameter is the given value $t$ on General Inversion Hyperbola,
-please refer to equation (\ref{ParametricFunctionOfGeneralInversionHyperbola}).
+The macro \Lcs{pstGeneralIHyperbolaNode} is used to draw a node whose parameter is the given value $t$ on General Conjugate Hyperbola,
+please refer to equation (\ref{ParametricFunctionOfGeneralConjugateHyperbola}).
-The macro \Lcs{pstGeneralIHyperbolaAbsNode} is used to draw the nodes whose abscissa are the given value $x_1$ on General Inversion Hyperbola.
-The macro \Lcs{pstGeneralIHyperbolaOrdNode} is used to draw the nodes whose ordinate are the given value $y_1$ on General Inversion Hyperbola.
+The macro \Lcs{pstGeneralIHyperbolaAbsNode} is used to draw the nodes whose abscissa are the given value $x_1$ on General Conjugate Hyperbola.
+The macro \Lcs{pstGeneralIHyperbolaOrdNode} is used to draw the nodes whose ordinate are the given value $y_1$ on General Conjugate Hyperbola.
Note that \Lcs{pstGeneralIHyperbolaAbsNode} and \Lcs{pstGeneralIHyperbolaOrdNode} will create two nodes $A$ and $B$ at most time.
@@ -3863,9 +3864,9 @@ Note that \Lcs{pstGeneralIHyperbolaAbsNode} and \Lcs{pstGeneralIHyperbolaOrdNode
\end{pspicture}
\end{LTXexample}
-The macro \Lcs{pstGeneralIHyperbolaFocusNode} is used to find the focus nodes of the General Inversion Hyperbola,
-the macro \Lcs{pstGeneralIHyperbolaVertexNode} is used to find the vertex nodes of the General Inversion Hyperbola,
-and the macro \Lcs{pstGeneralIHyperbolaDirectrixLine} is used to find the directrix lines of the General Inversion Hyperbola.
+The macro \Lcs{pstGeneralIHyperbolaFocusNode} is used to find the focus nodes of the General Conjugate Hyperbola,
+the macro \Lcs{pstGeneralIHyperbolaVertexNode} is used to find the vertex nodes of the General Conjugate Hyperbola,
+and the macro \Lcs{pstGeneralIHyperbolaDirectrixLine} is used to find the directrix lines of the General Conjugate Hyperbola.
\begin{BDef}
\Lcs{pstGeneralIHyperbolaFocusNode}\OptArgs\Largr{O}\Largr{$a,\,b$}\OptArg{$\theta$}\Largb{$F_1$}\Largb{$F_2$}\\
@@ -3901,7 +3902,7 @@ as the other one is the center of the hyperbola.
\end{LTXexample}
-The macro \Lcs{pstGeneralIHyperbolaLineInter} is used to find the intersections $C$ and $D$ of the general inversion hyperbola and the given line $AB$.
+The macro \Lcs{pstGeneralIHyperbolaLineInter} is used to find the intersections $C$ and $D$ of the general conjugate hyperbola and the given line $AB$.
\begin{BDef}
\Lcs{pstGeneralIHyperbolaLineInter}\OptArgs\Largr{O}\Largr{$a,\,b$}\OptArg{$\theta$}\Largb{$A$}\Largb{$B$}\Largb{$C$}\Largb{$D$}
@@ -3930,7 +3931,7 @@ so there are only one intersection $M$ and $P$ for each line, and the second nod
\end{pspicture}
\end{LTXexample}
-The macro \Lcs{pstGeneralIHyperbolaPolarNode} is used to find the polar point $T$ of chord $AB$ on the general inversion hyperbola.
+The macro \Lcs{pstGeneralIHyperbolaPolarNode} is used to find the polar point $T$ of chord $AB$ on the general conjugate hyperbola.
\begin{BDef}
\Lcs{pstGeneralIHyperbolaPolarNode}\OptArgs\Largr{O}\Largr{$a,\,b$}\OptArg{$\theta$}\Largb{$A$}\Largb{$B$}\Largb{$T$}
@@ -3951,7 +3952,7 @@ We also use the theorem \ref{HyperbolaPolarPointTheorem} to find the polar point
\end{pspicture}
\end{LTXexample}
-The macro \Lcs{pstGeneralIHyperbolaTangentNode} is used to find the tangent point $A$ and $B$ of point $T$ outside of the general inversion hyperbola.
+The macro \Lcs{pstGeneralIHyperbolaTangentNode} is used to find the tangent point $A$ and $B$ of point $T$ outside of the general conjugate hyperbola.
\begin{BDef}
\Lcs{pstGeneralIHyperbolaTangentNode}\OptArgs\Largr{O}\Largr{$a,\,b$}\OptArg{$\theta$}\Largb{$T$}\Largb{$A$}\Largb{$B$}
@@ -3970,6 +3971,187 @@ We also use the theorem \ref{HyperbolaTangentPointTheorem} to find the tangent p
\end{pspicture}
\end{LTXexample}
+\vspace{20pt}
+\subsection{General Conics}
+A General Conic is defined by the quadratic curve equation
+\begin{equation}\label{QuadraticCurveEquation}
+ax^2+bxy+cy^2+dx+ey+f=0
+\end{equation}
+it can be reduced to an ellipse, hyperbola or parabola after translation and rotation.
+
+In the previous sections, we use the macros \Lcs{pstGeneralEllipseCoef}, \Lcs{pstGeneralHyperbolaCoef}, \Lcs{pstGeneralParabolaCoef} to define the
+general ellipse, general hyperbola and general parabola from the quadratic curve equation (\ref{QuadraticCurveEquation}).
+Here we provide the macros \Lcs{pstGeneralConicEquation}, \Lcs{pstGeneralEllipseEquation}, \Lcs{pstGeneralHyperbolaEquation}
+and \Lcs{pstGeneralParabolaEquation} to get the coefficients $a,b,c,d,e,f$ of their quadratic curve equation (\ref{QuadraticCurveEquation}).
+
+\vspace{10pt}
+
+\begin{BDef}
+\Lcs{pstGeneralConicEquation}\OptArgs\Largb{A}\Largb{B}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\Largb{a,b,c,d,e,f}\\
+\Lcs{pstGeneralEllipseEquation}\OptArgs\Largr{O}\Largr{a,b}\OptArg{$\theta$}\Largb{a,b,c,d,e,f}\\
+\Lcs{pstGeneralHyperbolaEquation}\OptArgs\Largr{O}\Largr{a,b}\OptArg{$\theta$}\Largb{a,b,c,d,e,f}\\
+\Lcs{pstGeneralParabolaEquation}\OptArgs\Largr{O}\Largb{p}\OptArg{$\theta$}\Largb{a,b,c,d,e,f}
+\end{BDef}
+
+The macro \Lcs{pstGeneralConicEquation} take five points $A,B,C,D,E$ as input parameter;
+the macro \Lcs{pstGeneralEllipseEquation} take the general ellipse parameter $O,a,b,\theta$ as input parameter;
+the macro \Lcs{pstGeneralHyperbolaEquation} take the general hyperbola parameter $O,a,b,\theta$ as input parameter;
+the macro \Lcs{pstGeneralParabolaEquation} take the general parabola parameter $O,p,\theta$ as input parameter.
+They all output the six coefficients $a,b,c,d,e,f$ of the quadratic curve equation.
+
+Note that the output coefficients $a,b,c,d,e,f$ are the variables in \PS\ level,
+they will be dumped out in \PS's console when you set \Lkeyword{CodeFig} to \Lkeyword{true}.
+You can pass them into the macros where need these six coefficients.
+In order to prevent the name conflict in \PS\ level,
+You should setup the name of the coefficients more than three letters, for example,
+
+\vspace{10pt}
+
+\begin{lstlisting}
+% calculate the coefficients CoefA,CoefB,...,CoefF and CoefA',CoefB',...,CoefF'
+\pstGeneralConicEquation{A}{B}{C}{D}{E}{CoefA,CoefB,CoefC,CoefD,CoefE,CoefF}
+\pstGeneralConicEquation{A'}{B'}{C'}{D'}{E'}{CoefA',CoefB',CoefC',CoefD',CoefE',CoefF'}
+% then use them to find the intersections
+\pstGeneralConicInter{CoefA,CoefB,CoefC,CoefD,CoefE,CoefF}{CoefA',CoefB',CoefC',CoefD',CoefE',CoefF'}{I}{J}{I'}{J'}
+\end{lstlisting}
+
+\clearpage
+
+The following example output the coefficients $a,b,c,d,e,f$ for the ellipse defined by five points, and then draw the ellipse using these coefficients to check the result.
+\begin{LTXexample}[width=5cm,pos=l]
+\begin{pspicture}[showgrid=true](-1,-2)(4,3)
+\psset{unit=0.6cm}\footnotesize\psset{PointSymbol=*}
+\psset{CodeFig=false,CodeFigColor=gray!50}
+\pstGeonode[PosAngle={180,-90,90,-90,0}](0,0){A}(2,-1){B}(3,3){C}(4,0){D}(5,2){E}
+\pstGeneralEllipseABCDE[PosAngle=0]{A}{B}{C}{D}{E}{O}{R}{RotAngle}
+\pstGeneralEllipse[linecolor=red!60](O)(R)[RotAngle]
+\pstGeneralEllipseEquation(O)(R)[RotAngle]{a,b,c,d,e,f}
+\pstGeneralEllipseCoef[PosAngle=-80,CodeFigColor=blue!50]{a,b,c,d,e,f}{O'}{R'}{RotAngle1}
+\pstGeneralEllipse[linecolor=blue!60](O')(R')[RotAngle1][0][240]
+\end{pspicture}
+\end{LTXexample}
+
+\vspace{10pt}
+The following example output the coefficients $a,b,c,d,e,f$ for the hyperbola $2xy-x+2y+1=0$, just for example, and then draw the hyperbola using these coefficients to check the result.
+\begin{LTXexample}[width=5cm,pos=l]
+\begin{pspicture}[showgrid=true](-3,-2)(2,2)
+\psset{unit=0.6cm}\footnotesize\psset{PointSymbol=*}
+\psset{CodeFig=false,CodeFigColor=gray!50}
+% 2xy-x+2y+1=0
+\pstGeneralHyperbolaCoef[PosAngle=-100,CodeFigColor=red!50]{0,2,0,-1,2,1}{O_1}{R_1}{RotAngle}
+\pstGeneralHyperbola[linecolor=blue!60](O_1)(R_1)[RotAngle][56]
+\pstGeneralHyperbolaEquation(O_1)(R_1)[RotAngle]{a,b,c,d,e,f}
+\pstGeneralHyperbolaCoef[PosAngle=-10,CodeFigColor=red!60]{a,b,c,d,e,f}{O_2}{R_2}{RotAngle1}
+\pstGeneralHyperbola[linecolor=red](O_2)(R_2)[RotAngle1][25]
+\end{pspicture}
+\end{LTXexample}
+
+\vspace{10pt}
+The following example output the coefficients $a,b,c,d,e,f$ for the parabola defined by five points, and then draw the parabola using these coefficients to check the result.
+\begin{LTXexample}[width=5cm,pos=l]
+\begin{pspicture}[showgrid=true](0,-2)(4,2)
+\psset{unit=0.6cm}\footnotesize\psset{PointSymbol=*}
+\psset{CodeFig=false,CodeFigColor=gray!50}
+% five points from y^2-2x+3=0
+\pstGeonode[PosAngle={90,90,-90,90,-90}](3,1.73205){A}(2,1){B}(2,-1){C}(6,3){D}(6,-3){E}
+\pstGeneralParabolaABCDE[PosAngle=235]{A}{B}{C}{D}{E}{O}{P}{RotAngle}
+\pstGeneralParabola[linecolor=blue!60](O){P}[RotAngle]{-3}{3}
+\pstGeneralParabolaEquation(O){P}[RotAngle]{a,b,c,d,e,f}
+\pstGeneralParabolaCoef[PosAngle=140,CodeFigColor=black!60]{a,b,c,d,e,f}{O_2}{P2}{RotAngle1}
+\pstGeneralParabola[linecolor=red](O_2){P2}[RotAngle1]{-2}{2}
+\end{pspicture}
+\end{LTXexample}
+
+\clearpage
+Here are some macros to find the intersections with the quadratic curve equation (\ref{QuadraticCurveEquation}).
+
+\begin{BDef}
+\Lcs{pstGeneralConicLineInter}\OptArgs\Largb{A}\Largb{B}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\\
+\Lcs{pstGeneralConicCircleInter}\OptArgs\Largb{O}\Largb{A}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\\
+\Lcs{pstGeneralConicEllipseInter}\OptArgs\Largr{O}\Largr{m,n}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\\
+\Lcs{pstGeneralConicHyperbolaInter}\OptArgs\Largr{O}\Largr{m,n}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\\
+\Lcs{pstGeneralConicIHyperbolaInter}\OptArgs\Largr{O}\Largr{m,n}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\\
+\Lcs{pstGeneralConicParabolaInter}\OptArgs\Largr{O}\Largb{p}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\\
+\Lcs{pstGeneralConicIParabolaInter}\OptArgs\Largr{O}\Largb{p}\Largb{a,b,c,d,e,f}\Largb{C}\Largb{D}\Largb{E}\Largb{F}\\
+\Lcs{pstGeneralConicInter}\Largb{a,b,c,d,e,f}\Largb{a',b',c',d',e',f'}\Largb{C}\Largb{D}\Largb{E}\Largb{F}
+\end{BDef}
+
+\noindent
+The macro \Lcs{pstGeneralConicLineInter} is used to find the intersections $C,D$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given line $AB$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicCircleInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given circle $(x-x_A)^2+(y-y_A)^2=|OA|^2$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicEllipseInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given ellipse $\dfrac{(x-x_O)^2}{m^2}+\dfrac{(y-y_O)^2}{n^2}=1$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicHyperbolaInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given hyperbola $\dfrac{(x-x_O)^2}{m^2}-\dfrac{(y-y_O)^2}{n^2}=1$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicIHyperbolaInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given conjugate hyperbola $\dfrac{(y-y_O)^2}{m^2}-\dfrac{(x-x_O)^2}{n^2}=1$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicParabolaInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given parabola $(x-x_O)^2=2p(y-y_O)$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicIParabolaInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the given conjugate parabola $(y-y_O)^2=2p(x-x_O)$.\\[1mm]\noindent
+The macro \Lcs{pstGeneralConicInter} is used to find the intersections $C,D,E,F$ of the quadratic curve equation (\ref{QuadraticCurveEquation}) and the other one.\\\noindent
+
+\begin{LTXexample}[width=5cm,pos=l]
+\begin{pspicture}[showgrid=true](-4,-2)(1,2)\footnotesize
+\psset{unit=0.5cm,PointSymbol=*,dotscale=0.5,PointNameSep=0.24cm}
+\pstGeonode[PosAngle={0,-90}](-2,0){A}(-3,-2){B}
+\pstGeneralEllipseCoef[PosAngle=120]{1,2,4,6,8,1}{O}{R}{RotAngle}
+\pstGeneralEllipse[linecolor=blue!60](O)(R)[RotAngle]
+\pstGeneralConicLineInter[PosAngle={200,110}]{A}{B}{1,2,4,6,8,1}{C}{D}
+\pstGeneralConicCircleInter[PosAngle={-120,120,-65,60}]{O}{B}{1,2,4,6,8,1}{E}{F}{E'}{F'}
+\pstGeneralConicEllipseInter[PosAngle={210,120,-45,45}](O)(3,4){1,2,4,6,8,1}{G}{H}{G'}{H'}
+\pstGeneralConicHyperbolaInter[PosAngle={75,215,45,240}](O)(2,3){1,2,4,6,8,1}{I}{J}{I'}{J'}
+\pstGeneralConicParabolaInter[PosAngle={215,-90},PointName={M,N,none},PointSymbol={*,*,none}](O){8}{1,2,4,6,8,1}{M}{N}{M'}{N'}
+\pstLineAB[linecolor=gray!80]{C}{D}
+\pstCircleOA[linecolor=gray!80]{O}{B}
+\pstEllipse[linecolor=gray!80](O)(3,4)
+\pstHyperbola[linecolor=gray!80](O)(2,3)[56]
+\pstParabola[linecolor=gray!80](O){8}{-4}{4}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[width=5cm,pos=l]
+\begin{pspicture}[showgrid=true](-3,-2)(1,3)\footnotesize
+\psset{unit=0.5cm,PointSymbol=*,dotscale=0.5,PointNameSep=0.24cm}
+\pstGeonode[PosAngle={-90,-90}](-1.8,1){O}
+\pstEllipse[linecolor=gray!80](O)(4,3)
+\pstGeneralEllipse[linecolor=blue!60](O)(3,4)[32]
+\pstGeneralEllipse[linecolor=cyan!60](O)(3,4)[65]
+\pstGeneralEllipseEquation[CodeFig=false](O)(3,4)[32]{Ea,Eb,Ec,Ed,Ee,Ef}
+\pstGeneralEllipseEquation[CodeFig=false](O)(3,4)[65]{Ea',Eb',Ec',Ed',Ee',Ef'}
+\pstGeneralConicEllipseInter[PosAngle={-20,240,50,150}](O)(4,3){Ea,Eb,Ec,Ed,Ee,Ef}{C}{D}{C'}{D'}
+\pstGeneralConicEllipseInter[PosAngle={150,90,-100,-40}](O)(4,3){Ea',Eb',Ec',Ed',Ee',Ef'}{E}{F}{E'}{F'}
+\pstGeneralConicInter[PosAngle={100,60,240,-50}]{Ea,Eb,Ec,Ed,Ee,Ef}{Ea',Eb',Ec',Ed',Ee',Ef'}{G}{H}{G'}{H'}
+\end{pspicture}
+\end{LTXexample}
+
+Here are some macros to find the tangent line or tangent chord of the quadratic curve equation (\ref{QuadraticCurveEquation}).
+
+\vspace{10pt}
+
+\begin{BDef}
+\Lcs{pstGeneralConicTangentLine}\OptArgs\Largb{A}\Largb{a,b,c,d,e,f}\Largb{B}\\
+\Lcs{pstGeneralConicTangentChord}\OptArgs\Largb{T}\Largb{a,b,c,d,e,f}\Largb{A}\Largb{B}
+\end{BDef}
+
+The macro \Lcs{pstGeneralConicTangentLine} find the Tangent Line of the quadratic curve through
+the point $A$ which is lie on the curve, output the other node $B$ on the tangent line.
+The macro \Lcs{pstGeneralConicTangentChord} find the Tangent Chord of the quadratic curve through
+the point $T$ which is not lie on the curve, output the tangent point $A$ and $B$ on the curve.
+
+\begin{LTXexample}[width=5cm,pos=l]
+\begin{pspicture}[showgrid=true](-2,-2)(2,2)\footnotesize
+\psset{unit=0.3cm,PointSymbol=*,dotscale=0.5,PointNameSep=0.24cm}
+\pstGeonode[PosAngle={-90,-10,190,150,180}](3,1){A}(2,3){B}(-1.5,2){C}(-3,-5){D}(-2.0,-2.2){E}
+\pstGeneralConicEquation{A}{B}{C}{D}{E}{GCoefA,GCoefB,GCoefC,GCoefD,GCoefE,GCoefF}
+\pstGeneralHyperbolaCoef[PosAngle=-30]{GCoefA,GCoefB,GCoefC,GCoefD,GCoefE,GCoefF}{O}{R}{RotAngle}
+\pstGeneralHyperbola[linecolor=blue!40](O)(R)[RotAngle][72]
+\pstGeneralConicTangentLine[PosAngle={-70}]{E}{GCoefA,GCoefB,GCoefC,GCoefD,GCoefE,GCoefF}{F}
+\pstLineAB[linecolor=gray!60,nodesepA=-1]{E}{F}
+\pstGeonode[PosAngle=-90](1.8,-1.5){T}
+\pstGeneralConicTangentChord[PosAngle={20,60}]{T}{GCoefA,GCoefB,GCoefC,GCoefD,GCoefE,GCoefF}{M}{N}
+\pstLineAB[linecolor=red!60]{M}{N}
+\pstLineAB[linecolor=gray!60,nodesepB=-1]{T}{M}
+\pstLineAB[linecolor=gray!60,nodesepB=-1]{T}{N}
+\end{pspicture}
+\end{LTXexample}
+
+\clearpage
\section{Geometric Transformations}
The geometric transformations are the ideal tools to construct geometric figures. All
@@ -4534,7 +4716,7 @@ and \Lkeyword{PosAngleB} to change the default behavior.
This function put a point at the intersection between two curves
defined by a function. $x_0$ is an intersection approximated value of
-the abscissa. It is obviously possible to ise this function several
+the abscissa. It is obviously possible to use this function several
time if more than one intersection is present. Each function is
describerd in \PS in the same way as the description used by
the \Lcs{psplot} macro of \PST. A constant function can be
@@ -5401,5 +5583,3 @@ crossing a given point.
\end{document}
-
-
diff --git a/graphics/pstricks/contrib/pst-eucl/dvips/pst-eucl.pro b/graphics/pstricks/contrib/pst-eucl/dvips/pst-eucl.pro
index 503ed9c9a2..63c623737a 100644
--- a/graphics/pstricks/contrib/pst-eucl/dvips/pst-eucl.pro
+++ b/graphics/pstricks/contrib/pst-eucl/dvips/pst-eucl.pro
@@ -1,18 +1,23 @@
%!
% PostScript prologue for pst-eucl.tex.
-% Version 1.03 2020/01/09
+% Version 1.04 2020/09/29
% For distribution, see pstricks.tex.
%
/tx@EcldDict 40 dict def tx@EcldDict begin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Prcision
+/epsilon 1E-5 def
+/epsilonMin 1E-6 def
+/epsilonMax 1E-3 def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Pi
/Pi 3.14159265359 def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% e
/E 2.718281828459045 def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% x -> true (if |x| < 1E-6)
-/ZeroEq { abs 1E-6 lt } bind def
+%% x -> true (if |x| < epsilonMin)
+/ZeroEq { abs epsilonMin lt } bind def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% x1 y1 x2 y2 -> a b c (ax-by+c=0 with a^2+b^2=1)
/EqDr {
@@ -154,21 +159,21 @@
%% a11 a12 a13, a21 a22 a23, a31 a32 a33 -> X
/DeterminantThree {
% |a22 a23, a32 a33| * (-1)^(1+1)a11
- 8 index abs 1E-5 lt { %a11=0
+ 8 index abs epsilon lt { %a11=0
0
} {
4 index 4 index 3 index 3 index DeterminantTwo
9 index mul
} ifelse
% |a12 a13, a32 a33| * (-1)^(1+2)a21
- 6 index abs 1E-5 lt { %a12=0
+ 6 index abs epsilon lt { %a12=0
0 sub
} {
8 index 8 index 4 index 4 index DeterminantTwo
7 index mul sub
} ifelse
% |a12 a13, a22 a23| * (-1)^(1+3)a31
- 3 index abs 1E-5 lt { %a13=0
+ 3 index abs epsilon lt { %a13=0
0 add
} {
8 index 8 index 7 index 7 index DeterminantTwo
@@ -185,28 +190,28 @@
%% a11 a12 a13 a14, a21 a22 a23 a24, a31 a32 a33 a34, a41 a42 a43 a44 -> X
/DeterminantFour {
% |a22 a23 a24, a32 a33 a34, a42 a43 a44| * (-1)^(1+1)a11
- 15 index abs 1E-5 lt { %a11=0
+ 15 index abs epsilon lt { %a11=0
0
} {
10 index 10 index 10 index 9 index 9 index 9 index 8 index 8 index 8 index DeterminantThree
16 index mul
} ifelse
% |a12 a13 a14, a32 a33 a34, a42 a43 a44| * (-1)^(1+2)a21
- 12 index abs 1E-5 lt { %a21=0
+ 12 index abs epsilon lt { %a21=0
0 sub
} {
15 index 15 index 15 index 10 index 10 index 10 index 9 index 9 index 9 index DeterminantThree
13 index mul sub
} ifelse
% |a12 a13 a14, a22 a23 a24, a42 a43 a44| * (-1)^(1+3)a31
- 8 index abs 1E-5 lt { %a31=0
+ 8 index abs epsilon lt { %a31=0
0 add
} {
15 index 15 index 15 index 14 index 14 index 14 index 9 index 9 index 9 index DeterminantThree
9 index mul add
} ifelse
% |a12 a13 a14, a22 a23 a24, a32 a33 a34| * (-1)^(1+4)a41
- 4 index abs 1E-5 lt { %a41=0
+ 4 index abs epsilon lt { %a41=0
0 sub
} {
15 index 15 index 15 index 14 index 14 index 14 index 13 index 13 index 13 index DeterminantThree
@@ -225,35 +230,35 @@
%% a11 a12 a13 a14 a15, a21 a22 a23 a24 a25, a31 a32 a33 a34 a35, a41 a42 a43 a44 a45, a51 a52 a53 a54 a55-> X
/DeterminantFive {
% |a22 a23 a24 a25, a32 a33 a34 a35, a42 a43 a44 a45, a52 a53 a54 a55| * (-1)^(1+1)a11
- 24 index abs 1E-5 lt { %a11=0
+ 24 index abs epsilon lt { %a11=0
0
} {
18 index 18 index 18 index 18 index 17 index 17 index 17 index 17 index 16 index 16 index 16 index 16 index 15 index 15 index 15 index 15 index DeterminantFour
25 index mul
} ifelse
% |a12 a13 a14 a15, a32 a33 a34 a35, a42 a43 a44 a45, a52 a53 a54 a55| * (-1)^(1+2)a21
- 20 index abs 1E-5 lt { %a21=0
+ 20 index abs epsilon lt { %a21=0
0 sub
} {
24 index 24 index 24 index 24 index 18 index 18 index 18 index 18 index 17 index 17 index 17 index 17 index 16 index 16 index 16 index 16 index DeterminantFour
21 index mul sub
} ifelse
% |a12 a13 a14 a15, a22 a23 a24 a25, a42 a43 a44 a45, a52 a53 a54 a55| * (-1)^(1+3)a31
- 15 index abs 1E-5 lt { %a31=0
+ 15 index abs epsilon lt { %a31=0
0 add
} {
24 index 24 index 24 index 24 index 23 index 23 index 23 index 23 index 17 index 17 index 17 index 17 index 16 index 16 index 16 index 16 index DeterminantFour
16 index mul add
} ifelse
% |a12 a13 a14 a15, a22 a23 a24 a25, a32 a33 a34 a35, a52 a53 a54 a55| * (-1)^(1+4)a41
- 10 index abs 1E-5 lt { %a41=0
+ 10 index abs epsilon lt { %a41=0
0 sub
} {
24 index 24 index 24 index 24 index 23 index 23 index 23 index 23 index 22 index 22 index 22 index 22 index 16 index 16 index 16 index 16 index DeterminantFour
11 index mul sub
} ifelse
% |a12 a13 a14 a15, a22 a23 a24 a25, a32 a33 a34 a35, a42 a43 a44 a45| * (-1)^(1+5)a51
- 5 index abs 1E-5 lt { %a51=0
+ 5 index abs epsilon lt { %a51=0
0 add
} {
24 index 24 index 24 index 24 index 23 index 23 index 23 index 23 index 22 index 22 index 22 index 22 index 21 index 21 index 21 index 21 index DeterminantFour
@@ -263,6 +268,863 @@
pop pop pop pop pop pop pop pop pop pop
pop pop pop pop pop
} def
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Conic Intersections
+% The following macros implements the conic intersectionpoints in Asymptote
+% module geometry.asy provided by Philippe IVALDI.
+% http://www.piprime.fr/files/asymptote/geometry/modules/geometry.asy.html
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% num len [array] numIsInArray -> bool
+/numIsInArray {
+ /arr ED /len ED /num ED
+ /res false def
+ 0 1 len 1 sub {
+ /idx ED
+ /val arr idx get def
+ num val sub abs epsilonMax lt {
+ /res true def
+ exit
+ } if
+ } for
+ res
+} def
+
+% find the real roots of quadratic equation ax^2+bx+c=0
+% a b c -> [roots] nroots
+/QuadraticRealRoots {
+15 dict begin % all variables are local
+ /Coefc ED /Coefb ED /Coefa ED
+ /nroots 0 def /roots 2 array def
+ %[ Coefa Coefb Coefc ] ==
+ Coefa abs epsilonMin lt {
+ Coefb abs epsilonMin gt {
+ roots 0 Coefc Coefb div neg put
+ /nroots 1 def
+ }
+ }{
+ /delta Coefb Coefb mul 4 Coefc Coefa mul mul sub def
+ delta abs epsilon lt {
+ roots 0 Coefb 2 Coefa mul div neg put
+ /nroots 1 def
+ }{
+ delta 0.0 gt {
+ /delta delta sqrt def
+ roots 0 Coefb neg delta add 2 Coefa mul div put
+ roots 1 Coefb neg delta sub 2 Coefa mul div put
+ /nroots 2 def
+ } if
+ } ifelse
+ } ifelse
+ roots nroots % push the roots on stack.
+end} def
+
+% find the real roots of cubic equation a*x^3+b*x^2+c*x+d=0
+% a b c d CubicRealRoots -> [roots] nroots
+/CubicRealRoots {
+15 dict begin % all variables are local
+ /Coefd ED /Coefc ED /Coefb ED /Coefa ED
+ % [ Coefa Coefb Coefc Coefd ] ==
+ /nroots 0 def /roots 3 array def
+ Coefa abs epsilonMin lt { % quadratic case
+ Coefb Coefc Coefd QuadraticRealRoots
+ /nroots ED roots copy pop
+ }{% true cubic
+ % normalize to x^3+bx^2+cx+d=0
+ /Coefb Coefb Coefa div def
+ /Coefc Coefc Coefa div def
+ /Coefd Coefd Coefa div def
+ % let x=y-b/3, we have
+ % y^3+py+q=0
+ % where p=(3c-b^2)/3,q=(27d-9bc+2b^3)/27
+ % let y=u+v, where uv=-p/3, then
+ % u^3+v^3=-q, u^3v^3=-p^3/27
+ % then u^3=-q/2-\sqrt(q^2/4+p^3/27)
+ % u^3=-q/2+\sqrt(q^2/4+p^3/27)
+ % http://eqworld.ipmnet.ru/en/solutions/ae/ae0103.pdf
+ Coefb abs epsilonMin lt {
+ /bthird 0 def
+ /p Coefc def
+ /q Coefd def
+ }{
+ /bthird Coefb 3 div def
+ /p 3 Coefc mul Coefb Coefb mul sub 3 div def
+ /q 27 Coefd mul 9 Coefb mul Coefc mul sub 2 Coefb mul Coefb mul Coefb mul add 27 div def
+ } ifelse
+ /ppp p dup dup mul mul def
+ /qq q dup mul def
+ /delta qq 4 div ppp 27 div add def
+ % p = q = delta =
+ delta abs epsilon lt {
+ q abs epsilon lt {
+ /nroots 1 def
+ roots 0 bthird neg put
+ }{
+ /nroots 2 def
+ q 0.0 gt {
+ /r1 q 2 div 1 3 div exp def
+ }{
+ /r1 q 2 div neg 1 3 div exp neg def
+ } ifelse
+ /r2 r1 -2 mul def
+ roots 0 r1 bthird sub put
+ roots 1 r2 bthird sub put
+ } ifelse
+ }{
+ delta 0.0 gt {
+ /nroots 1 def
+ /qhalfneg q 2 div neg def
+ /deltasqrt delta sqrt def
+ /pthirdneg p 3 div neg def
+ p abs epsilon lt {
+ /tu qhalfneg deltasqrt add def
+ /tv qhalfneg deltasqrt sub def
+ tu abs epsilon lt {
+ /u 0.0 def
+ }{
+ tu 0.0 gt {
+ /u tu 1 3 div exp def
+ }{
+ /u tu neg 1 3 div exp neg def
+ } ifelse
+ } ifelse
+ tv abs epsilon lt {
+ /v 0.0 def
+ }{
+ tv 0.0 gt {
+ /v tv 1 3 div exp def
+ }{
+ /v tv neg 1 3 div exp neg def
+ } ifelse
+ } ifelse
+ }{
+ /tu qhalfneg deltasqrt add def
+ tu 0.0 gt {
+ /u tu 1 3 div exp def
+ }{
+ /u tu neg 1 3 div exp neg def
+ } ifelse
+ /v pthirdneg u div def
+ } ifelse
+ /r1 u v add def
+ roots 0 r1 bthird sub put
+ }{
+ /nroots 3 def
+ /qhalfneg q 2 div neg def
+ /pthirdnegsqrt p 3 div neg sqrt def
+ /argalpha qhalfneg pthirdnegsqrt dup dup mul mul div Acos 3 div def
+ /r1 pthirdnegsqrt 2 mul argalpha cos mul def
+ /r2 pthirdnegsqrt -2 mul argalpha 60 add cos mul def
+ /r3 pthirdnegsqrt -2 mul argalpha 60 sub cos mul def
+ roots 0 r1 bthird sub put
+ roots 1 r2 bthird sub put
+ roots 2 r3 bthird sub put
+ } ifelse
+ } ifelse
+ } ifelse
+ roots nroots % push the roots on stack.
+end} def
+
+% find the real roots of quartic equation a*x^4+b*x^3+c*x^2+dx+e=0
+% a b c d e QuarticRealRoots -> [roots] nroots
+/QuarticRealRoots {
+15 dict begin % all variables are local
+ /Coefe ED /Coefd ED /Coefc ED /Coefb ED /Coefa ED
+ /nroots 0 def /roots 4 array def
+ Coefa abs epsilonMin lt { % cubic case
+ Coefb Coefc Coefd Coefe CubicRealRoots
+ /nroots ED roots copy pop
+ }{
+ Coefe abs epsilonMin lt { % cubic case
+ Coefa Coefb Coefc Coefd CubicRealRoots
+ /nroots ED roots copy pop
+ roots nroots 0.0 put
+ /nroots nroots 1 add def
+ }{ % true quartic
+ % normalize to x^4+bx^3+cx^2+dx+e=0
+ /Coefb Coefb Coefa div def
+ /Coefc Coefc Coefa div def
+ /Coefd Coefd Coefa div def
+ /Coefe Coefe Coefa div def
+ /qeval {
+ /vx ED
+ 1 vx mul Coefb add vx mul Coefc add vx mul Coefd add vx mul Coefe add % x(x(x(ax+b)+c)+d)+e
+ } def
+ % [1 Coefb Coefc Coefd Coefe ] ==
+ % x^4+bx^3+cx^2+dx+e=0
+ % (x^2+b/2x)^2=(b^2/4-c)x^2-dx-e
+ % add (x^2+b/2x)y+y^2/4 in each side,
+ % (x^2+b/2x+y/2)^2=(b^2/4+y-c)x^2+(by/2-d)x+(y^2/4-e)
+ % choose y such that
+ % (by/2-d)^2-4(b^2/4+y-c)(y^2/4-e)=0
+ % i.e,
+ % y^3-cy^2+(bd-4e)y-eb^2+4ec-d^2=0
+ % let t=sqrt(b^2/4+y-c), then
+ % (x^2+b/2x+y/2)^2=(tx+(by/2-d)/(2t))^2
+ % we have
+ % x^2+(b/2+t)x+y/2+(by/2-d)/(2t)=0
+ % x^2+(b/2-t)x+y/2-(by/2-d)/(2t)=0
+ 1 Coefc neg Coefb Coefd mul 4 Coefe mul sub 4 Coefc Coefe mul mul Coefb Coefb Coefe mul mul sub Coefd Coefd mul sub
+ CubicRealRoots /CubicNumRoots ED /CubicRoots ED
+ %CubicNumRoots = CubicRoots ==
+ 0 1 CubicNumRoots 1 sub {
+ /idx ED
+ /y0 CubicRoots idx get def
+ /delta y0 Coefc sub Coefb Coefb mul 4 div add def
+ % [ idx y0 delta ] ==
+ delta abs epsilonMax lt {
+ /squareval y0 y0 mul 4 div Coefe sub def
+ squareval abs epsilon lt {
+ % x^2+b/2x+y/2=0
+ %[squareval (squareval=0) ] ==
+ 1 Coefb 2 div y0 2 div QuadraticRealRoots
+ /nroots1 ED /roots1 ED %nroots1 = roots1 ==
+ 0 1 nroots1 1 sub {
+ /idx ED
+ /rv roots1 idx get def
+ rv qeval abs epsilonMax lt {
+ rv nroots roots numIsInArray not {
+ roots nroots rv put
+ /nroots nroots 1 add def
+ } if
+ } if
+ } for
+ }{
+ squareval 0.0 gt {
+ %[squareval (squareval>0) ] ==
+ % x^2+b/2x+y/2\pm\sqrt(y^2/4-e)=0
+ /squareval squareval sqrt def
+ 1 Coefb 2 div y0 2 div squareval add QuadraticRealRoots
+ /nroots1 ED /roots1 ED %nroots1 = roots1 ==
+ 1 Coefb 2 div y0 2 div squareval sub QuadraticRealRoots
+ /nroots2 ED /roots2 ED %nroots2 = roots2 ==
+ nroots1 0 gt nroots2 0 gt or {
+ 0 1 nroots1 1 sub {
+ /idx ED
+ /rv roots1 idx get def
+ rv qeval abs epsilonMax lt {
+ rv nroots roots numIsInArray not {
+ roots nroots rv put
+ /nroots nroots 1 add def
+ } if
+ } if
+ } for
+ 0 1 nroots2 1 sub {
+ /idx ED
+ /rv roots2 idx get def
+ rv qeval abs epsilonMax lt {
+ rv nroots roots numIsInArray not {
+ roots nroots rv put
+ /nroots nroots 1 add def
+ } if
+ } if
+ } for
+ } if
+ } if
+ } ifelse
+ }{
+ delta 0.0 gt {
+ %[delta (delta>0) ] ==
+ /sqrtdelta delta sqrt def
+ /Coefp Coefb 2 div sqrtdelta add def
+ /Coefq y0 2 div y0 Coefb mul 2 div Coefd sub sqrtdelta div 2 div add def
+ 1 Coefp Coefq QuadraticRealRoots /nroots1 ED /roots1 ED %nroots1 = roots1 ==
+ /Coefp Coefb 2 div sqrtdelta sub def
+ /Coefq y0 2 div y0 Coefb mul 2 div Coefd sub sqrtdelta div 2 div sub def
+ 1 Coefp Coefq QuadraticRealRoots /nroots2 ED /roots2 ED %nroots2 = roots2 ==
+ nroots1 0 gt nroots2 0 gt or {
+ 0 1 nroots1 1 sub {
+ /idx ED
+ /rv roots1 idx get def
+ rv qeval abs epsilonMax lt {
+ rv nroots roots numIsInArray not {
+ roots nroots rv put
+ /nroots nroots 1 add def
+ } if
+ } if
+ } for
+ 0 1 nroots2 1 sub {
+ /idx ED
+ /rv roots2 idx get def
+ rv qeval abs epsilonMax lt {
+ rv nroots roots numIsInArray not {
+ roots nroots rv put
+ /nroots nroots 1 add def
+ } if
+ } if
+ } for
+ } if
+ } if
+ } ifelse
+ nroots 4 eq {
+ exit
+ } if
+ } for
+ } ifelse
+ } ifelse
+ roots nroots % push the roots on stack.
+end} def
+
+% SortInters
+% sort the intersections from smallest to largest abscissa.
+% [Inters] nInters SortInters -> [Inters] nInters
+/SortInters {
+ /nInters ED /Inters ED
+ nInters 1 gt {
+ /PairCmp {
+ /PairB ED /PairA ED
+ PairA 0 get PairB 0 get sub
+ } def
+ /PairSwap {
+ /PairB ED /PairA ED /IdxB ED /IdxA ED
+ Inters IdxA PairB put
+ Inters IdxB PairA put
+ } def
+ 0 1 nInters 2 sub {
+ /Idx ED
+ 0 1 nInters 2 sub Idx sub {
+ /Bubidx ED
+ /PairA Inters Bubidx get def
+ /PairB Inters Bubidx 1 add get def
+ PairA PairB PairCmp 0 gt {
+ Bubidx Bubidx 1 add
+ PairA PairB PairSwap
+ } if
+ } for
+ } for
+ } if
+ Inters nInters % push the intersections on stack.
+} def
+
+% ConicCircleInter
+% find all intersections of conic $cc(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% circle $c(x,y)=(x-x0)^2+(y-y0)^2=r^2$.
+%
+% a b c d e f x0 y0 r ConicCircleInter -> [Inters] nInters
+/ConicCircleInter {
+15 dict begin % all variables are local
+ /cr ED /cy0 ED /cx0 ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ %[ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /m 2 cca mul cx0 mul ccb cy0 mul add ccd add def
+ /n 2 ccc mul cy0 mul ccb cx0 mul add cce add def
+ /s cx0 cy0 cceval def
+ /p s cr div ccc cr mul add def
+ /t cca cr mul ccc cr mul sub def
+ % [ m n s p t ] ==
+ /Qqa ccb ccb mul cr mul cr mul t t mul add def
+ /Qqb 2 t mul m mul 2 n mul ccb mul cr mul add def
+ /Qqc m m mul n n mul add 2 t mul p mul add ccb ccb mul cr mul cr mul sub def
+ /Qqd 2 m mul p mul 2 n mul ccb mul cr mul sub def
+ /Qqe p p mul n n mul sub def
+ %[ Qqa Qqb Qqc Qqd Qqe ] ==
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nroots ED /roots ED
+ %nroots = roots ==
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ 0 1 nroots 1 sub {
+ /idx ED
+ /cosx roots idx get def
+ /sinx 1.0 cosx cosx mul sub sqrt def
+ /x cr cosx mul cx0 add def
+ /y cr sinx mul cy0 add def
+ /ccxy x y cceval def
+ % [idx 0 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ /y cr sinx mul neg cy0 add def
+ /ccxy x y cceval def
+ % [idx 1 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
+
+% ConicEllipseInter
+% find all intersections of conic $cc(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% ellipse $e(x,y): (x-x0)^2/m^2+(y-y0)^2/n^2=1$.
+%
+% a b c d e f x0 y0 m n ConicEllipseInter -> [Inters] nInters
+/ConicEllipseInter {
+15 dict begin % all variables are local
+ /en ED /em ED /ey0 ED /ex0 ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ %[ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /p 2 cca mul em mul ex0 mul ccb em mul ey0 mul add ccd em mul add def
+ /q 2 ccc mul en mul ey0 mul ccb en mul ex0 mul add cce en mul add def
+ /r ex0 ey0 cceval def
+ /s r ccc en mul en mul add def
+ /t cca em mul em mul ccc en mul en mul sub def
+ % [ p q r s t ] ==
+ /Qqa t t mul ccb ccb mul em mul em mul en mul en mul add def
+ /Qqb 2 t mul p mul 2 q mul ccb mul em mul en mul add def
+ /Qqc p p mul q q mul add 2 t mul s mul add ccb ccb mul em mul em mul en mul en mul sub def
+ /Qqd 2 p mul s mul 2 q mul ccb mul em mul en mul sub def
+ /Qqe s s mul q q mul sub def
+ %[ Qqa Qqb Qqc Qqd Qqe ] ==
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nroots ED /roots ED
+ %nroots = roots ==
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ 0 1 nroots 1 sub {
+ /idx ED
+ /cosx roots idx get def
+ /sinx 1.0 cosx cosx mul sub sqrt def
+ /x em cosx mul ex0 add def
+ /y en sinx mul ey0 add def
+ /ccxy x y cceval def
+ % [idx 0 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ /y en sinx mul neg ey0 add def
+ /ccxy x y cceval def
+ % [idx 1 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
+
+% ConicHyperbolaInter
+% find all intersections of conic $cc(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% hyperbola $h(x,y): (x-x0)^2/m^2-(y-y0)^2/n^2=1$.
+%
+% a b c d e f x0 y0 m n ConicHyperbolaInter -> [Inters] nInters
+/ConicHyperbolaInter {
+15 dict begin % all variables are local
+ /hn ED /hm ED /hy0 ED /hx0 ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ %[ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /p 2 cca mul hm mul hx0 mul ccb hm mul hy0 mul add ccd hm mul add def
+ /q 2 ccc mul hn mul hy0 mul ccb hn mul hx0 mul add cce hn mul add def
+ /r hx0 hy0 cceval def
+ /s r ccc hn mul hn mul sub def
+ /t cca hm mul hm mul ccc hn mul hn mul add def
+ % [ p q r s t ] ==
+ /Qqe t t mul ccb ccb mul hm mul hm mul hn mul hn mul sub def
+ /Qqd 2 t mul p mul 2 q mul ccb mul hm mul hn mul sub def
+ /Qqc p p mul q q mul sub 2 t mul s mul add ccb ccb mul hm mul hm mul hn mul hn mul add def
+ /Qqb 2 p mul s mul 2 q mul ccb mul hm mul hn mul add def
+ /Qqa s s mul q q mul add def
+ %[ Qqa Qqb Qqc Qqd Qqe ] ==
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nroots ED /roots ED
+ % nroots = roots ==
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ 0 1 nroots 1 sub {
+ /idx ED
+ /cosx roots idx get def
+ /sinx 1.0 cosx cosx mul sub sqrt def
+ /x hm cosx div hx0 add def
+ /y hn sinx mul cosx div hy0 add def
+ /ccxy x y cceval def
+ % [idx 0 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ /y hn sinx mul cosx div neg hy0 add def
+ /ccxy x y cceval def
+ % [idx 1 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
+
+% ConicIHyperbolaInter
+% find all intersections of conic $cc(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% conjugate hyperbola $h(x,y): (y-y0)^2/m^2-(x-x0)^2/n^2=1$.
+%
+% a b c d e f x0 y0 m n ConicIHyperbolaInter -> [Inters] nInters
+/ConicIHyperbolaInter {
+15 dict begin % all variables are local
+ /hn ED /hm ED /hy0 ED /hx0 ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ % [ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /p 2 ccc mul hm mul hy0 mul ccb hm mul hx0 mul add cce hm mul add def
+ /q 2 cca mul hn mul hx0 mul ccb hn mul hy0 mul add ccd hn mul add def
+ /r hx0 hy0 cceval def
+ /s r cca hn mul hn mul sub def
+ /t cca hn mul hn mul ccc hm mul hm mul add def
+ % [ p q r s t ] ==
+ /Qqe t t mul ccb ccb mul hm mul hm mul hn mul hn mul sub def
+ /Qqd 2 t mul p mul 2 q mul ccb mul hm mul hn mul sub def
+ /Qqc p p mul q q mul sub 2 t mul s mul add ccb ccb mul hm mul hm mul hn mul hn mul add def
+ /Qqb 2 p mul s mul 2 q mul ccb mul hm mul hn mul add def
+ /Qqa s s mul q q mul add def
+ %[ Qqa Qqb Qqc Qqd Qqe ] ==
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nroots ED /roots ED
+ %nroots = roots ==
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ 0 1 nroots 1 sub {
+ /idx ED
+ /cosx roots idx get def
+ /sinx 1.0 cosx cosx mul sub sqrt def
+ /x hn sinx mul cosx div hx0 add def
+ /y hm cosx div hy0 add def
+ /ccxy x y cceval def
+ % [idx 0 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ /x hn sinx mul cosx div neg hx0 add def
+ /ccxy x y cceval def
+ % [idx 1 cosx sinx x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
+
+% ConicParabolaInter
+% find all intersections of conic $cc(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% parabola $p(x,y): (x-x0)^2=2p(y-y0)$.
+%
+% a b c d e f x0 y0 p ConicParabolaInter -> [Inters] nInters
+/ConicParabolaInter {
+15 dict begin % all variables are local
+ /pp ED /py0 ED /px0 ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ % [ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /Qqa ccc 4 pp pp mul mul div def
+ /Qqb ccb 2 pp mul div def
+ /Qqc cca ccb px0 mul 2 pp mul div add ccc py0 mul pp div add cce 2 pp mul div add def
+ /Qqd 2 cca px0 mul mul ccb py0 mul add ccd add def
+ /Qqe px0 py0 cceval def
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nroots ED /roots ED
+ %nroots = roots ==
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ 0 1 nroots 1 sub {
+ /idx ED
+ /argt roots idx get def
+ /x argt px0 add def
+ /y argt argt mul 2 pp mul div py0 add def
+ /ccxy x y cceval def
+ % [idx 0 argt x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
+
+% ConicIParabolaInter
+% find all intersections of conic $cc(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% conjugate parabola $p(x,y): (y-y0)^2=2p(x-x0)$.
+%
+% a b c d e f x0 y0 p ConicIParabolaInter -> [Inters] nInters
+/ConicIParabolaInter {
+15 dict begin % all variables are local
+ /pp ED /py0 ED /px0 ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ % [ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /Qqa cca 4 pp pp mul mul div def
+ /Qqb ccb 2 pp mul div def
+ /Qqc ccc ccb py0 mul 2 pp mul div add cca px0 mul pp div add ccd 2 pp mul div add def
+ /Qqd 2 ccc py0 mul mul ccb px0 mul add cce add def
+ /Qqe px0 py0 cceval def
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nroots ED /roots ED
+ % nroots = roots ==
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ 0 1 nroots 1 sub {
+ /idx ED
+ /argt roots idx get def
+ /y argt py0 add def
+ /x argt argt mul 2 pp mul div px0 add def
+ /ccxy x y cceval def
+ % [idx 0 argt x y ccxy ] ==
+ ccxy abs epsilonMax lt {
+ x y SaveInter
+ } if
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
+
+% ConicInter
+% find all intersections of conic $cc1(x,y)=ax^2+bxy+cy^2+dx+ey+f=0$ and
+% $cc2(x,y)=a'x^2+b'xy+c'y^2+d'x+e'y+f'=0$.
+%
+% a b c d e f a' b' c' d' e' f' ConicInter -> [Inters] nInters
+/ConicInter {
+15 dict begin % all variables are local
+ /cxf ED /cxe ED /cxd ED /cxc ED /cxb ED /cxa ED
+ /ccf ED /cce ED /ccd ED /ccc ED /ccb ED /cca ED
+ % [ cxa cxb cxc cxd cxe cxf ] ==
+ % [ cca ccb ccc ccd cce ccf ] ==
+ % x y cceval -> cc(x,y)
+ /cceval {
+ /ty ED /tx ED
+ cca tx mul tx mul
+ ccb tx mul ty mul add
+ ccc ty mul ty mul add
+ ccd tx mul add
+ cce ty mul add
+ ccf add
+ } def
+ /cxeval {
+ /ty ED /tx ED
+ cxa tx mul tx mul
+ cxb tx mul ty mul add
+ cxc ty mul ty mul add
+ cxd tx mul add
+ cxe ty mul add
+ cxf add
+ } def
+ /nInters 0 def /Inters 4 array def
+ /SaveInter {
+ /tty ED /ttx ED
+ nInters 4 lt {
+ Inters nInters [ttx tty] put
+ /nInters nInters 1 add def
+ } if
+ } def
+ cca cxa sub abs epsilon gt
+ ccb cxb sub abs epsilon gt
+ ccc cxc sub abs epsilon gt or or {
+ /Qqa -2 cca ccc cxa cxc mul mul mul mul
+ cca ccc cxb cxb mul mul mul add
+ cca ccb cxc cxb mul mul mul sub
+ ccb ccb cxa cxc mul mul mul add
+ ccc ccb cxa cxb mul mul mul sub
+ cca cca cxc cxc mul mul mul add
+ ccc ccc cxa cxa mul mul mul add def
+ /Qqb ccc ccb cxa cxe mul mul mul neg
+ ccc cce cxa cxb mul mul mul sub
+ ccb ccd cxc cxb mul mul mul sub
+ 2 cca ccc cxb cxe mul mul mul mul add
+ cca ccb cxc cxe mul mul mul sub
+ ccb ccb cxc cxd mul mul mul add
+ 2 ccc ccd cxa cxc mul mul mul mul sub
+ 2 cca ccc cxc cxd mul mul mul mul sub
+ ccc ccd cxb cxb mul mul mul add
+ ccc ccb cxb cxd mul mul mul sub
+ 2 ccb cce cxa cxc mul mul mul mul add
+ 2 ccc ccc cxa cxd mul mul mul mul add
+ cca cce cxc cxb mul mul mul sub
+ 2 cca ccd cxc cxc mul mul mul mul add def
+ /Qqc ccd cce cxc cxb mul mul mul neg
+ ccc ccf cxb cxb mul mul mul add
+ ccb ccf cxc cxb mul mul mul sub
+ ccb ccd cxc cxe mul mul mul sub
+ ccb ccb cxc cxf mul mul mul add
+ 2 ccc ccd cxc cxd mul mul mul mul sub
+ 2 ccc ccc cxa cxf mul mul mul mul add
+ 2 cca ccf cxc cxc mul mul mul mul add
+ ccd ccd cxc cxc mul mul mul add
+ 2 ccc ccf cxa cxc mul mul mul mul sub
+ 2 ccb cce cxc cxd mul mul mul mul add
+ ccc cce cxb cxd mul mul mul sub
+ 2 cca ccc cxc cxf mul mul mul mul sub
+ ccc ccc cxd cxd mul mul mul add
+ 2 ccc ccd cxb cxe mul mul mul mul add
+ ccc cce cxa cxe mul mul mul sub
+ cce cce cxa cxc mul mul mul add
+ ccc ccb cxd cxe mul mul mul sub
+ ccc ccb cxb cxf mul mul mul sub
+ cca cce cxc cxe mul mul mul sub
+ cca ccc cxe cxe mul mul mul add def
+ /Qqd cce ccf cxc cxb mul mul mul neg
+ ccc ccd cxe cxe mul mul mul add
+ 2 ccd ccf cxc cxc mul mul mul mul add
+ ccc ccb cxe cxf mul mul mul sub
+ ccc cce cxd cxe mul mul mul sub
+ 2 ccc ccc cxd cxf mul mul mul mul add
+ 2 ccc ccd cxc cxf mul mul mul mul sub
+ ccd cce cxc cxe mul mul mul sub
+ 2 ccc ccf cxc cxd mul mul mul mul sub
+ ccc cce cxb cxf mul mul mul sub
+ 2 ccb cce cxc cxf mul mul mul mul add
+ ccb ccf cxc cxe mul mul mul sub
+ cce cce cxc cxd mul mul mul add
+ 2 ccc ccf cxb cxe mul mul mul mul add def
+ /Qqe -2 ccc ccf cxc cxf mul mul mul mul
+ cce cce cxc cxf mul mul mul add
+ ccf ccf cxc cxc mul mul mul add
+ cce ccf cxc cxe mul mul mul sub
+ ccc ccf cxe cxe mul mul mul add
+ ccc ccc cxf cxf mul mul mul add
+ ccc cce cxe cxf mul mul mul sub def
+ % [ Qqa Qqb Qqc Qqd Qqe ] ==
+ Qqa Qqb Qqc Qqd Qqe QuarticRealRoots /nQRoots ED /QRoots ED
+ } {
+ cce cxe sub abs epsilon gt {
+ /D cxe cce sub dup mul def
+ /Qda cca cxe cxe mul mul
+ ccb ccd mul ccb cxd mul sub 2 cca cce mul mul mul sub cxe mul add
+ ccc cxd cxd mul mul add
+ ccb cce mul 2 ccc ccd mul mul sub cxd mul add
+ cca cce cce mul mul add
+ ccb ccd cce mul mul sub
+ ccc ccd ccd mul mul add D div def
+ /Qdb ccb cxe mul 2 ccc cxd mul mul sub ccb cce mul sub 2 ccc ccd mul mul add cxf mul
+ ccd cxe cxe mul mul sub
+ cce cxd mul ccb ccf mul sub ccd cce mul add cxe mul add
+ 2 ccc ccf mul mul cce cce mul sub cxd mul add
+ ccb cce mul 2 ccc ccd mul mul sub ccf mul add
+ D div neg def
+ /Qdc ccc ccf cxf sub dup mul mul D div
+ cce ccf cxf sub mul cxe cce sub div add ccf add def
+ Qda Qdb Qdc QuadraticRealRoots /nQRoots ED /QRoots ED
+ } {
+ ccd cxd sub abs epsilon gt {
+ /D cxd ccd sub def
+ /Qda ccc def
+ /Qdb ccb cxf mul neg cce cxd mul add ccb ccf mul add ccd cce mul sub D div def
+ /Qdc cca ccf cxf sub dup mul mul D dup mul div ccd ccf cxf sub mul D div add ccf add def
+ Qda Qdb Qdc QuadraticRealRoots /nDRoots ED /DRoots ED
+ 0 1 nDRoots 1 sub {
+ /DIdx ED
+ /DVal DRoots DIdx get def
+ /Qea cca def
+ /Qeb ccb DVal mul ccd add def
+ /Qec ccc DVal dup mul mul cce DVal mul add ccf add def
+ Qea Qeb Qec QuadraticRealRoots /nERoots ED /ERoots ED
+ 0 1 nERoots 1 sub {
+ /EIdx ED
+ /XVal ERoots EIdx get def
+ /ccxy XVal DVal cceval def
+ /cxxy XVal DVal cxeval def
+ ccxy abs epsilonMax lt cxxy abs epsilonMax lt and {
+ XVal DVal SaveInter
+ } if
+ } for
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+ exit
+ } {
+ ccf cxf sub abs epsilon lt {
+ (cannot find intersection of identical conics) =
+ exit
+ } if
+ } ifelse
+ } ifelse
+ } ifelse
+ 0 1 nQRoots 1 sub {
+ /QIdx ED
+ /QVal QRoots QIdx get def
+ /Qea ccc def
+ /Qeb ccb QVal mul cce add def
+ /Qec cca QVal dup mul mul ccd QVal mul add ccf add def
+ Qea Qeb Qec QuadraticRealRoots /nERoots ED /ERoots ED
+ 0 1 nERoots 1 sub {
+ /EIdx ED
+ /YVal ERoots EIdx get def
+ /ccxy QVal YVal cceval def
+ /cxxy QVal YVal cxeval def
+ ccxy abs epsilonMax lt cxxy abs epsilonMax lt and {
+ QVal YVal SaveInter
+ } if
+ } for
+ } for
+ Inters nInters SortInters% push the intersections on stack.
+end} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
% END ps-euclide.pro
diff --git a/graphics/pstricks/contrib/pst-eucl/latex/pst-eucl.sty b/graphics/pstricks/contrib/pst-eucl/latex/pst-eucl.sty
index 0d6347c3d2..659904003b 100644
--- a/graphics/pstricks/contrib/pst-eucl/latex/pst-eucl.sty
+++ b/graphics/pstricks/contrib/pst-eucl/latex/pst-eucl.sty
@@ -2,7 +2,7 @@
\RequirePackage{pst-node}
\RequirePackage{pst-tools}
\RequirePackage{pst-calculate}
-\ProvidesPackage{pst-eucl}[2014/05/17 package wrapper for PSTricks pst-eucl.tex]
+\ProvidesPackage{pst-eucl}[2020/09/29 package wrapper for PSTricks pst-eucl.tex]
\DeclareOption{old}{\gdef\psteucl@old{}}% DR 10/05/2005
\ProcessOptions
\input{pst-eucl.tex}
@@ -10,6 +10,6 @@
[\filedate\space v\fileversion\space `PST-eucl' (dr,hv)]
\IfFileExists{pst-eucl.pro}{%
\ProvidesFile{pst-eucl.pro}
- [2020/01/29 v. 1.03, PostScript prologue file (hv)]
+ [2020/09/29 v. 1.04, PostScript prologue file (hv)]
\@addtofilelist{pst-eucl.pro}}{}%
\endinput
diff --git a/graphics/pstricks/contrib/pst-eucl/tex/pst-eucl.tex b/graphics/pstricks/contrib/pst-eucl/tex/pst-eucl.tex
index cfc56a70d8..12f75bb8c8 100644
--- a/graphics/pstricks/contrib/pst-eucl/tex/pst-eucl.tex
+++ b/graphics/pstricks/contrib/pst-eucl/tex/pst-eucl.tex
@@ -9,6 +9,7 @@
%%
%% Authors : Dominique RODRIGUEZ (EN) <dominique.rodriguez@waika9.com>
%% : hv hvoss@tug.org
+%% : lx Liao Xiongfei
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Require PSTricks and pst-node packages
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
@@ -20,8 +21,8 @@
\csname PSTEuclideLoaded\endcsname
\let\PSTEuclideLoaded\endinput
%
-\def\fileversion{1.74}
-\def\filedate{2020/07/15}
+\def\fileversion{1.75}
+\def\filedate{2020/09/29}
%%
\message{`PST-Euclide v\fileversion, \filedate\space (dr,hv)}%
%% prologue for postcript
@@ -632,7 +633,7 @@
%% \pstTriangleSSS[Options](pos){A}(a,b,c){B}{C}
%% Create a triangle ABC whose three sides are a,b,c.
%% Given $A(x_1,y_1)$, and the three sides $a,b,c$,
-%% when pos=L, we output $B(x_2,y_2)$ and $C(x_3,y_3)$ as following
+%% when pos=:L, we output $B(x_2,y_2)$ and $C(x_3,y_3)$ as following
%% $$x_2=x_1+c,y_2=y_1$$
%% since
%% $$\cos{A}=\dfrac{c^2+b^2-a^2}{2bc}$$
@@ -645,7 +646,7 @@
%%
%% Parameters:
%% #1 -> options
-%% #2 -> optional, the pos of given input node A, L/R/U/D
+%% #2 -> optional, the pos of given input node A, :L/:R/:U/:D or the other node to specify the base line of the triangle
%% #3 -> the given input node A
%% #4 -> the given side BC=a
%% #5 -> the given side CA=b
@@ -657,12 +658,12 @@
\begingroup
\@InitListMng%
\psset{#1}%
- \@ifnextchar(\Pst@TriangleSSS@i{\Pst@TriangleSSS@i(L)}}
+ \@ifnextchar(\Pst@TriangleSSS@i{\Pst@TriangleSSS@i(:L)}}
\def\Pst@TriangleSSS@i(#1)#2(#3,#4,#5)#6#7{%
- \def\Pst@TriangleSSS@left{L}
- \def\Pst@TriangleSSS@right{R}
- \def\Pst@TriangleSSS@up{U}
- \def\Pst@TriangleSSS@down{D}
+ \def\Pst@TriangleSSS@left{:L}
+ \def\Pst@TriangleSSS@right{:R}
+ \def\Pst@TriangleSSS@up{:U}
+ \def\Pst@TriangleSSS@down{:D}
\def\Pst@TriangleSSS@pos{#1}
\pst@getcoor{#2}\pst@tempA%
\ifx\Pst@TriangleSSS@pos\Pst@TriangleSSS@right%
@@ -719,7 +720,7 @@
2 index dup mul 1 index 7 index sub dup mul sub sqrt 5 index add
7 2 roll pop pop pop pop pop
){#7}%C
- \else% default position is at left vertex
+ \else\ifx\Pst@TriangleSSS@pos\Pst@TriangleSSS@left
\pnode(!
\pst@tempA \tx@UserCoor % x1,y1
#3 abs #4 abs #5 abs % a,b,c
@@ -735,7 +736,10 @@
2 index dup mul 1 index 7 index sub dup mul sub sqrt 5 index add
7 2 roll pop pop pop pop pop
){#7}%C
- \fi\fi\fi%
+ \else% try to locate the triangle on the specific line
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#1}{\pstDistConst{#5}}{#6}
+ \pstInterCC[PointName=none,PointSymbol=none,RadiusA=\pstDistConst{#4},RadiusB=\pstDistConst{#3}]{#2}{}{#6}{}{#7}{#7Unused}
+ \fi\fi\fi\fi%
\Pst@ManageParamList{#6}%
\Pst@ManageParamList{#7}%
\pstPolygon(#2)(#6)(#7)%
@@ -745,14 +749,14 @@
%% \pstTriangleSAS[Options](pos){A}(b,A,c){B}{C}
%% Create a triangle ABC whth sides b,c and angle A.
%% Given $A(x_1,y_1)$, and the angle of A, the other two sides $b,c$,
-%% when pos=L, we output $B(x_2,y_2)$ and $C(x_3,y_3)$ as following
+%% when pos=:L, we output $B(x_2,y_2)$ and $C(x_3,y_3)$ as following
%% $$x_2=x_1+c,y_2=y_1$$
%% and
%% $$x_3=x_1+b\cos{A},y_3=y_1+b\sin{A}$$
%%
%% Parameters:
%% #1 -> options
-%% #2 -> optional, the pos of given input node A, L/R/U/D
+%% #2 -> optional, the pos of given input node A, :L/:R/:U/:D or the other node to specify the base line of the triangle
%% #3 -> the given input node A
%% #4 -> the given side AC=b
%% #5 -> the given angle A
@@ -764,12 +768,12 @@
\begingroup
\@InitListMng%
\psset{#1}%
- \@ifnextchar(\Pst@TriangleSAS@i{\Pst@TriangleSAS@i(L)}}
+ \@ifnextchar(\Pst@TriangleSAS@i{\Pst@TriangleSAS@i(:L)}}
\def\Pst@TriangleSAS@i(#1)#2(#3,#4,#5)#6#7{%
- \def\Pst@TriangleSAS@left{L}
- \def\Pst@TriangleSAS@right{R}
- \def\Pst@TriangleSAS@up{U}
- \def\Pst@TriangleSAS@down{D}
+ \def\Pst@TriangleSAS@left{:L}
+ \def\Pst@TriangleSAS@right{:R}
+ \def\Pst@TriangleSAS@up{:U}
+ \def\Pst@TriangleSAS@down{:D}
\def\Pst@TriangleSAS@pos{#1}
\pst@getcoor{#2}\pst@tempA%
\ifx\Pst@TriangleSAS@pos\Pst@TriangleSAS@right%
@@ -834,7 +838,7 @@
6 index 5 index dup mul 3 index dup mul add 4 index dup mul sub 3 index 2 mul div sub exch % x3
8 2 roll pop pop pop pop pop pop
){#7}%
- \else% default position is at left vertex
+ \else\ifx\Pst@TriangleSAS@pos\Pst@TriangleSAS@left
\pnode(!
\pst@tempA \tx@UserCoor % x1,y1
#3 abs #4 abs #5 abs % b,A,c
@@ -849,7 +853,11 @@
4 index 4 index 4 index sin mul add
7 2 roll pop pop pop pop pop
){#7}%
- \fi\fi\fi%
+ \else% try to locate the triangle on the specific line
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#1}{\pstDistConst{#5}}{#6}
+ \pstRotation[PointName=none,PointSymbol=none,RotAngle=#4]{#2}{#6}[#6Internal]
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#6Internal}{\pstDistConst{#3}}{#7}
+ \fi\fi\fi\fi%
\Pst@ManageParamList{#6}%
\Pst@ManageParamList{#7}%
\pstPolygon(#2)(#6)(#7)%
@@ -860,7 +868,7 @@
%% Create a triangle ABC with angle A,C and side AB=c.
%%
%% Given $A(x_1,y_1)$, and the angle of A, the angle of C, the side of AB $c$,
-%% when pos=L, we output $B(x_2,y_2)$ and $C(x_3,y_3)$ as following
+%% when pos=:L, we output $B(x_2,y_2)$ and $C(x_3,y_3)$ as following
%% $$x_2=x_1+c,y_2=y_1$$
%% and
%% $$x_3=x_1+b\cos{A}=x_1+\dfrac{c\sin{B}}{\sin{C}}\cos{A},y_3=y_1+b\sin{A}=y_1+\dfrac{c\sin{B}}{\sin{C}}\sin{A}$$
@@ -868,7 +876,7 @@
%%
%% Parameters:
%% #1 -> options
-%% #2 -> optional, the pos of given input node A, L/R/U/D
+%% #2 -> optional, the pos of given input node A, :L/:R/:U/:D or the other node to specify the base line of the triangle
%% #3 -> the given input node A
%% #4 -> the given angle C
%% #5 -> the given angle A
@@ -880,12 +888,12 @@
\begingroup
\@InitListMng%
\psset{#1}%
- \@ifnextchar(\Pst@TriangleAAS@i{\Pst@TriangleAAS@i(L)}}
+ \@ifnextchar(\Pst@TriangleAAS@i{\Pst@TriangleAAS@i(:L)}}
\def\Pst@TriangleAAS@i(#1)#2(#3,#4,#5)#6#7{%
- \def\Pst@TriangleAAS@left{L}
- \def\Pst@TriangleAAS@right{R}
- \def\Pst@TriangleAAS@up{U}
- \def\Pst@TriangleAAS@down{D}
+ \def\Pst@TriangleAAS@left{:L}
+ \def\Pst@TriangleAAS@right{:R}
+ \def\Pst@TriangleAAS@up{:U}
+ \def\Pst@TriangleAAS@down{:D}
\def\Pst@TriangleAAS@pos{#1}
\pst@getcoor{#2}\pst@tempA%
\ifx\Pst@TriangleAAS@pos\Pst@TriangleAAS@right%
@@ -941,7 +949,7 @@
4 index 2 index 5 index 5 index add sin mul add % y3
7 2 roll pop pop pop pop pop
){#7}%
- \else% default position is at left vertex
+ \else\ifx\Pst@TriangleAAS@pos\Pst@TriangleAAS@left
\pnode(!
\pst@tempA \tx@UserCoor % x1,y1
#3 abs #4 abs #5 abs % C,A,c
@@ -958,7 +966,11 @@
3 index sin 2 index mul 6 index add
8 2 roll pop pop pop pop pop pop
){#7}%
- \fi\fi\fi%
+ \else% try to locate the triangle on the specific line
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#1}{\pstDistConst{#5}}{#6}
+ \pstRotation[PointName=none,PointSymbol=none,RotAngle=#4]{#2}{#6}[#6Internal]
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#6Internal}{\pstDistConst{#5} #3 #4 add sin #3 sin div mul}{#7}
+ \fi\fi\fi\fi%
\Pst@ManageParamList{#6}%
\Pst@ManageParamList{#7}%
\pstPolygon(#2)(#6)(#7)%
@@ -977,7 +989,7 @@
%%
%% Parameters:
%% #1 -> options
-%% #2 -> optional, the pos of given input node A, L/R/U/D
+%% #2 -> optional, the pos of given input node A, :L/:R/:U/:D or the other node to specify the base line of the triangle
%% #3 -> the given input node A
%% #4 -> the given angle A
%% #5 -> the given side AB=c
@@ -989,12 +1001,12 @@
\begingroup
\@InitListMng%
\psset{#1}%
- \@ifnextchar(\Pst@TriangleASA@i{\Pst@TriangleASA@i(L)}}
+ \@ifnextchar(\Pst@TriangleASA@i{\Pst@TriangleASA@i(:L)}}
\def\Pst@TriangleASA@i(#1)#2(#3,#4,#5)#6#7{%
- \def\Pst@TriangleASA@left{L}
- \def\Pst@TriangleASA@right{R}
- \def\Pst@TriangleASA@up{U}
- \def\Pst@TriangleASA@down{D}
+ \def\Pst@TriangleASA@left{:L}
+ \def\Pst@TriangleASA@right{:R}
+ \def\Pst@TriangleASA@up{:U}
+ \def\Pst@TriangleASA@down{:D}
\def\Pst@TriangleASA@pos{#1}
\pst@getcoor{#2}\pst@tempA%
\ifx\Pst@TriangleASA@pos\Pst@TriangleASA@right%
@@ -1048,7 +1060,7 @@
4 index 3 index 3 index sin mul add % y3
7 2 roll pop pop pop pop pop
){#7}%
- \else% default position is at left vertex
+ \else\ifx\Pst@TriangleASA@pos\Pst@TriangleASA@left
\pnode(!
\pst@tempA \tx@UserCoor % x1,y1
#3 abs #4 abs #5 abs % A,c,B
@@ -1065,7 +1077,11 @@
4 index sin 2 index mul 6 index add
8 2 roll pop pop pop pop pop pop
){#7}%
- \fi\fi\fi%
+ \else% try to locate the triangle on the specific line
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#1}{\pstDistConst{#4}}{#6}
+ \pstRotation[PointName=none,PointSymbol=none,RotAngle=#3]{#2}{#6}[#6Internal]
+ \pstLocateAB[PointName=none,PointSymbol=none]{#2}{#6Internal}{\pstDistConst{#4} #5 sin #3 #5 add sin div mul}{#7}
+ \fi\fi\fi\fi%
\Pst@ManageParamList{#6}%
\Pst@ManageParamList{#7}%
\pstPolygon(#2)(#6)(#7)%
@@ -1776,7 +1792,7 @@
\pst@number\psxunit div 3 1 roll div x mul add }
{ \ifPst@algebraic (#2) AlgParser cvx exec \else #2 \fi }
NewtonSolving pop 2 copy end
- /#5.Y exch def /#5.X exch def % save the coors for futher use
+ /#6.Y exch def /#6.X exch def % save the coors for futher use
){#6}%
\Pst@geonodelabel{#6}%
\egroup%
@@ -1803,7 +1819,7 @@
pop dup /x exch def
\@function
2 copy end
- /#4.Y exch def /#4.X exch def % save the coors for futher use
+ /#5.Y exch def /#5.X exch def % save the coors for futher use
){#5}%
\Pst@geonodelabel{#5}%
\endgroup
@@ -2357,7 +2373,7 @@
%% #2 -> [input] the node A
%% #3 -> [input] the node B
%% #4 -> [input] the node C
-%% #5 -> [output] the output Lemoine Point L
+%% #5 -> [output] the output Lemoine Point L
%% #6 -> [output] the optional output point on BC
%% #7 -> [output] the optional output point on CA
%% #8 -> [output] the optional output point on AB
@@ -3864,7 +3880,7 @@
%% #1 -> options
%% #2 -> the input node A
%% #3 -> the input node B
-%% #4 -> the input radius length in screen coordinate
+%% #4 -> the input radius length in screen coordinate
%% #5 -> the output center O
\def\pstCircleABR{\@ifnextchar[\Pst@CircleABR{\Pst@CircleABR[]}}%
\def\Pst@CircleABR[#1]#2#3#4#5{%
@@ -3915,7 +3931,7 @@
%% Draw an equilateral triangle ABC on given side AB in anti-clockwise.
%% Parameters:
%% #1 -> options
-%% #2 -> [input] the node A
+%% #2 -> [input] the node A
%% #3 -> [input] the node B
%% #4 -> [output] the node C
\def\pstETriangleAB{\@ifnextchar[\Pst@ETriangleAB{\Pst@ETriangleAB[]}}
@@ -3932,7 +3948,7 @@
%% Draw a square ABCD on given side AB in anti-clockwise.
%% Parameters:
%% #1 -> options
-%% #2 -> [input] the node A
+%% #2 -> [input] the node A
%% #3 -> [input] the node B
%% #4 -> [output] the node C
%% #5 -> [output] the node D
@@ -3966,7 +3982,7 @@
\edef\@@GenCourbe{(#2)(#3)}%%for accumulating points
\ifPst@CodeFig
\pstCircleABR[PointName=O,PosAngle=-90,PointSymbol=*,linecolor=\psk@CodeFigColor,linestyle=\psk@CodeFigStyle]{#2}{#3}{\pstDist{#2}{#3} 2 div 180 #4 div sin div}{PolyCenter}
- \else
+ \else
\pstCircleABR[PointName=none,PointSymbol=none,linestyle=none]{#2}{#3}{\pstDist{#2}{#3} 2 div 180 #4 div sin div}{PolyCenter}
\fi
\psset{#1} % use parameters after calling \pstCircleABR.
@@ -3984,7 +4000,7 @@
%\typeout{\@@GenCourbe}
\Pst@ManageParamList{\@point}\xdef\@PointLast{\@point}%
\edef\@PointOutLst{\expandafter\PstParamListLasts\@PointOutLst,undef/}%
- \advance\pst@cntg by 1
+ \advance\pst@cntg by 1
\edef\@point{\expandafter\PstParamListFirst\@PointOutLst,undef/}
\ifnum\pst@cntg<\pst@cnth%
\def\@End{\Pst@RegularPolygonAB@iii}
@@ -4023,7 +4039,7 @@
%\typeout{\@@GenCourbe}
\Pst@ManageParamList{\@point}\xdef\@PointLast{\@point}%
\edef\@PointOutLst{\expandafter\PstParamListLasts\@PointOutLst,undef/}%
- \advance\pst@cntg by 1
+ \advance\pst@cntg by 1
\edef\@point{\expandafter\PstParamListFirst\@PointOutLst,undef/}
\ifnum\pst@cntg<\pst@cnth%
\def\@End{\Pst@RegularPolygonOA@iii}
@@ -4635,9 +4651,9 @@
Fax Fay Fbx Fby
tx@EcldDict begin ABDist end
2 div /EllipseC ED
- Nx Ny Fax Fay
+ Nx Ny Fax Fay
tx@EcldDict begin ABDist end
- Nx Ny Fbx Fby
+ Nx Ny Fbx Fby
tx@EcldDict begin ABDist end
add 2 div /EllipseA ED
EllipseA dup mul EllipseC dup mul sub sqrt /EllipseB ED
@@ -4762,54 +4778,66 @@
\CurveCoefd\space 2 div /CurveCoefd ED
\CurveCoefe\space 2 div /CurveCoefe ED
\CurveCoeff /CurveCoeff ED
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
% I1=a+c
CurveCoefa CurveCoefc add /DiscriminantI ED
% I2=ac-b^2
CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
- DiscriminantII 0 le { % if I2\le0
- 0 0
- 0 /MyEllipseA ED
- 0 /MyEllipseB ED
- 0 /#5 ED
- }{
- CurveCoefa CurveCoefc sub dup mul 4 CurveCoefb dup mul mul add sqrt /CurveCoefTempA ED
- CurveCoefa CurveCoefe dup mul mul CurveCoefc CurveCoefd dup mul mul add
- CurveCoeff CurveCoefb dup mul mul add 2 CurveCoefb mul CurveCoefd mul
- CurveCoefe mul sub CurveCoefa CurveCoefc mul CurveCoeff mul sub 2 mul /CurveCoefTempB ED
- % Ra = sqrt((2(ae^2+cd^2+fb^2-2bde-acf))/((ac-b^2)[(a+c)-sqrt((a-c)^2+4b^2)]))
- CurveCoefTempB DiscriminantII DiscriminantI CurveCoefTempA sub mul div /MyEllipseSquareA ED
- % Rb = sqrt((2(ae^2+cd^2+fb^2-2bde-acf))/((ac-b^2)[(a+c)+sqrt((a-c)^2+4b^2)]))
- CurveCoefTempB DiscriminantII DiscriminantI CurveCoefTempA add mul div /MyEllipseSquareB ED
- MyEllipseSquareA 0 lt MyEllipseSquareB 0 lt or {
+ % I3=|a b d,b c e,d e f|
+ CurveCoefa CurveCoefb CurveCoefd
+ CurveCoefb CurveCoefc CurveCoefe
+ CurveCoefd CurveCoefe CurveCoeff
+ tx@EcldDict begin DeterminantThree end /DiscriminantIII ED
+ % DiscriminantI = DiscriminantII = DiscriminantIII =
+ DiscriminantII 0 gt { % if I2>0
+ % Solve the Characteristic Equation: \lambda^2-I_1\lambda+I_2=0
+ DiscriminantI dup mul 4 DiscriminantII mul sub dup 0 lt {
0 0
0 /MyEllipseA ED
0 /MyEllipseB ED
0 /#5 ED
} {
- MyEllipseSquareA sqrt /MyEllipseA ED
- MyEllipseSquareB sqrt /MyEllipseB ED
- CurveCoefb abs 1E-5 lt { % b == 0
- CurveCoefa CurveCoefc lt { % a < c
- 0 /#5 ED
+ sqrt dup DiscriminantI exch sub 2 div /CharacteristicLambdaI ED
+ DiscriminantI add 2 div /CharacteristicLambdaII ED
+ % CharacteristicLambdaI = CharacteristicLambdaII =
+ % 20200726 Liaoxiongfei
+ % fix how to get the rotation of the ellipse major axis.
+ % since we can reduce the ellipse to
+ % \lambda_1x^2+\lambda_2y^2+I_3/I_2=0
+ % so the major axis is determined by the characteristic root with the small absolute value,
+ % and the slope of major axis is $(\lambda_1-a)/b$, or $(c-\lambda_2)/b$, where |\lambda_1|\leq|\lambda_2|
+ CharacteristicLambdaI abs CharacteristicLambdaII abs lt {
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyEllipseA ED
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyEllipseB ED
+ CharacteristicLambdaI CurveCoefa lt {
+ CharacteristicLambdaI CurveCoefa sub neg CurveCoefb neg atan /#5 ED
} {
- 90 /#5 ED
+ CharacteristicLambdaI CurveCoefa sub abs 1E-5 lt CurveCoefb abs 1E-5 lt and {
+ /#5 0 def
+ }{
+ CharacteristicLambdaI CurveCoefa sub CurveCoefb atan /#5 ED
+ } ifelse
} ifelse
} {
- CurveCoefa CurveCoefc sub abs 1E-5 lt { % a = c
- 45 /#5 ED
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyEllipseA ED
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyEllipseB ED
+ CharacteristicLambdaII CurveCoefa lt {
+ CharacteristicLambdaII CurveCoefa sub neg CurveCoefb neg atan /#5 ED
} {
- CurveCoefb 0 lt {
- 2 CurveCoefb mul neg CurveCoefc CurveCoefa sub atan /MyEllipseAngDbl ED
- MyEllipseAngDbl 2 div /#5 ED
- } {
- 2 CurveCoefb mul CurveCoefa CurveCoefc sub atan /MyEllipseAngDbl ED
- MyEllipseAngDbl 180 add 2 div /#5 ED
- } ifelse
+ CharacteristicLambdaII CurveCoefa sub CurveCoefb atan /#5 ED
} ifelse
} ifelse
- CurveCoefb CurveCoefe mul CurveCoefd CurveCoefc mul sub DiscriminantII div % x0
+ % MyEllipseA = MyEllipseB = #5 = (--------------) =
+ % F_1(x,y)=ax+by+d=0
+ % F_2(x,y)=bx+cy+e=0
+ CurveCoefb CurveCoefe mul CurveCoefc CurveCoefd mul sub DiscriminantII div % x0
CurveCoefb CurveCoefd mul CurveCoefa CurveCoefe mul sub DiscriminantII div % y0
} ifelse
+ } {
+ 0 0
+ 0 /MyEllipseA ED
+ 0 /MyEllipseB ED
+ 0 /#5 ED
} ifelse
){#3}
\Pst@geonodelabel{#3}%
@@ -4852,7 +4880,8 @@
\pst@CurveNodeD \tx@UserCoor /CurveNodeDY ED /CurveNodeDX ED
\pst@CurveNodeE \tx@UserCoor /CurveNodeEY ED /CurveNodeEX ED
%%
- % ax^2+bxy+cy^2+dx+ey+f=0, let a=1, we can use A,B,C,D,E to solve b,c,d,e,f, we have
+ % ax^2+bxy+cy^2+dx+ey+f=0, since $I_2=ac-b^2/4>0$, so $a\neq0$.
+ % let a=1, we can use A,B,C,D,E to solve b,c,d,e,f, we have
% AxAy b + Ay^2 c + Ax d + Ay e + 1 f = -Ax^2
% BxBy b + By^2 c + Bx d + By e + 1 f = -Bx^2
% CxCy b + Cy^2 c + Cx d + Cy e + 1 f = -Cx^2
@@ -4872,10 +4901,11 @@
CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY 1
tx@EcldDict begin DeterminantFive end /LinearDiscriminant ED
LinearDiscriminant abs 1E-5 lt { % D=0
- 0 0
- 0 /MyEllipseA ED
- 0 /MyEllipseB ED
- 0 /#9 ED
+ 0 /CurveCoefb ED
+ 0 /CurveCoefc ED
+ 0 /CurveCoefd ED
+ 0 /CurveCoefe ED
+ 0 /CurveCoeff ED
} {
1 /CurveCoefa ED
CurveNodeAX dup mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
@@ -4908,56 +4938,94 @@
CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX CurveNodeDY CurveNodeDX dup mul
CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY CurveNodeEX dup mul
tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoeff ED
- % the following is same with pstGeneralEllipseCoef.
- % I1=a+c
- CurveCoefa CurveCoefc add /DiscriminantI ED
- % I2=ac-b^2
- CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
- DiscriminantII 0 le { % if I2\le0
+ } ifelse
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ 0 /CurveCoefMax ED 1E8 /CurveCoefMin ED
+ CurveCoefa abs CurveCoefMax gt {CurveCoefa abs /CurveCoefMax ED} if
+ CurveCoefb abs CurveCoefMax gt {CurveCoefb abs /CurveCoefMax ED} if
+ CurveCoefc abs CurveCoefMax gt {CurveCoefc abs /CurveCoefMax ED} if
+ CurveCoefd abs CurveCoefMax gt {CurveCoefd abs /CurveCoefMax ED} if
+ CurveCoefe abs CurveCoefMax gt {CurveCoefe abs /CurveCoefMax ED} if
+ CurveCoeff abs CurveCoefMax gt {CurveCoeff abs /CurveCoefMax ED} if
+ CurveCoefa abs CurveCoefMin lt {CurveCoefa abs /CurveCoefMin ED} if
+ CurveCoefb abs CurveCoefMin lt {CurveCoefb abs /CurveCoefMin ED} if
+ CurveCoefc abs CurveCoefMin lt {CurveCoefc abs /CurveCoefMin ED} if
+ CurveCoefd abs CurveCoefMin lt {CurveCoefd abs /CurveCoefMin ED} if
+ CurveCoefe abs CurveCoefMin lt {CurveCoefe abs /CurveCoefMin ED} if
+ CurveCoeff abs CurveCoefMin lt {CurveCoeff abs /CurveCoefMin ED} if
+ % CurveCoefMin = CurveCoefMax =
+ CurveCoefMin CurveCoefMax div 1E-5 lt {
+ CurveCoefa CurveCoefMax div /CurveCoefa ED
+ CurveCoefb CurveCoefMax div /CurveCoefb ED
+ CurveCoefc CurveCoefMax div /CurveCoefc ED
+ CurveCoefd CurveCoefMax div /CurveCoefd ED
+ CurveCoefe CurveCoefMax div /CurveCoefe ED
+ CurveCoeff CurveCoefMax div /CurveCoeff ED
+ } if
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ CurveCoefa abs 1E-5 lt {0 /CurveCoefa ED} if
+ CurveCoefb abs 1E-5 lt {0 /CurveCoefb ED} if
+ CurveCoefc abs 1E-5 lt {0 /CurveCoefc ED} if
+ CurveCoefd abs 1E-5 lt {0 /CurveCoefd ED} if
+ CurveCoefe abs 1E-5 lt {0 /CurveCoefe ED} if
+ CurveCoeff abs 1E-5 lt {0 /CurveCoeff ED} if
+ % the following is same with pstGeneralEllipseCoef.
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ % I1=a+c
+ CurveCoefa CurveCoefc add /DiscriminantI ED
+ % I2=ac-b^2
+ CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
+ % I3=|a b d,b c e,d e f|
+ CurveCoefa CurveCoefb CurveCoefd
+ CurveCoefb CurveCoefc CurveCoefe
+ CurveCoefd CurveCoefe CurveCoeff
+ tx@EcldDict begin DeterminantThree end /DiscriminantIII ED
+ % DiscriminantI = DiscriminantII = DiscriminantIII =
+ DiscriminantII 0 gt { % if I2>0
+ % Solve the Characteristic Equation: \lambda^2-I_1\lambda+I_2=0
+ DiscriminantI dup mul 4 DiscriminantII mul sub dup 0 lt {
0 0
0 /MyEllipseA ED
0 /MyEllipseB ED
0 /#9 ED
- }{
- CurveCoefa CurveCoefc sub dup mul 4 CurveCoefb dup mul mul add sqrt /CurveCoefTempA ED
- CurveCoefa CurveCoefe dup mul mul CurveCoefc CurveCoefd dup mul mul add
- CurveCoeff CurveCoefb dup mul mul add 2 CurveCoefb mul CurveCoefd mul
- CurveCoefe mul sub CurveCoefa CurveCoefc mul CurveCoeff mul sub 2 mul /CurveCoefTempB ED
- % Ra = sqrt((2(ae^2+cd^2+fb^2-2bde-acf))/((ac-b^2)[(a+c)-sqrt((a-c)^2+4b^2)]))
- CurveCoefTempB DiscriminantII DiscriminantI CurveCoefTempA sub mul div /MyEllipseSquareA ED
- % Rb = sqrt((2(ae^2+cd^2+fb^2-2bde-acf))/((ac-b^2)[(a+c)+sqrt((a-c)^2+4b^2)]))
- CurveCoefTempB DiscriminantII DiscriminantI CurveCoefTempA add mul div /MyEllipseSquareB ED
- MyEllipseSquareA 0 lt MyEllipseSquareB 0 lt or {
- 0 0
- 0 /MyEllipseA ED
- 0 /MyEllipseB ED
- 0 /#9 ED
+ } {
+ sqrt dup DiscriminantI exch sub 2 div /CharacteristicLambdaI ED
+ DiscriminantI add 2 div /CharacteristicLambdaII ED
+ % CharacteristicLambdaI = CharacteristicLambdaII =
+ % 20200726 Liaoxiongfei
+ % fix how to get the rotation of the ellipse major axis.
+ % since we can reduce the ellipse to
+ % \lambda_1x^2+\lambda_2y^2+I_3/I_2=0
+ % so the major axis is determined by the characteristic root with the small absolute value,
+ % and the slope of major axis is $(\lambda_1-a)/b$, or $(c-\lambda_2)/b$, where |\lambda_1|\leq|\lambda_2|
+ CharacteristicLambdaI abs CharacteristicLambdaII abs lt {
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyEllipseA ED
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyEllipseB ED
+ CharacteristicLambdaI CurveCoefa lt {
+ CharacteristicLambdaI CurveCoefa sub neg CurveCoefb neg atan /#9 ED
+ } {
+ CharacteristicLambdaI CurveCoefa sub CurveCoefb atan /#9 ED
+ } ifelse
} {
- MyEllipseSquareA sqrt /MyEllipseA ED
- MyEllipseSquareB sqrt /MyEllipseB ED
- CurveCoefb abs 1E-5 lt { % b == 0
- CurveCoefa CurveCoefc lt { % a < c
- 0 /#9 ED
- } {
- 90 /#9 ED
- } ifelse
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyEllipseA ED
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyEllipseB ED
+ CharacteristicLambdaII CurveCoefa lt {
+ CharacteristicLambdaII CurveCoefa sub neg CurveCoefb neg atan /#9 ED
} {
- CurveCoefa CurveCoefc sub abs 1E-5 lt { % a = c
- 45 /#9 ED
- } {
- CurveCoefb 0 lt {
- 2 CurveCoefb mul neg CurveCoefc CurveCoefa sub atan /MyEllipseAngDbl ED
- MyEllipseAngDbl 2 div /#9 ED
- } {
- 2 CurveCoefb mul CurveCoefa CurveCoefc sub atan /MyEllipseAngDbl ED
- MyEllipseAngDbl 180 add 2 div /#9 ED
- } ifelse
- } ifelse
+ CharacteristicLambdaII CurveCoefa sub CurveCoefb atan /#9 ED
} ifelse
- CurveCoefb CurveCoefe mul CurveCoefd CurveCoefc mul sub DiscriminantII div % x0
- CurveCoefb CurveCoefd mul CurveCoefa CurveCoefe mul sub DiscriminantII div % y0
} ifelse
+ % MyEllipseA = MyEllipseB = #9 = (--------------) =
+ % F_1(x,y)=ax+by+d=0
+ % F_2(x,y)=bx+cy+e=0
+ CurveCoefb CurveCoefe mul CurveCoefc CurveCoefd mul sub DiscriminantII div % x0
+ CurveCoefb CurveCoefd mul CurveCoefa CurveCoefe mul sub DiscriminantII div % y0
} ifelse
+ } {
+ 0 0
+ 0 /MyEllipseA ED
+ 0 /MyEllipseB ED
+ 0 /#9 ED
} ifelse
){#7}
\Pst@geonodelabel{#7}%
@@ -5960,15 +6028,15 @@
\endgroup%
}%
%
-% 4. Standard Inversion Parabola with coordinate translation
+% 4. Standard Conjugate Parabola with coordinate translation
%% ----------------------------------------------------------
-%% The Inversion Parabola P is defined by vertex O, the half of the focus chord axis $abs(p)$, the sign of $p$ indicates the direction of the parabola.
+%% The Conjugate Parabola P is defined by vertex O, the half of the focus chord axis $abs(p)$, the sign of $p$ indicates the direction of the parabola.
%% The equation can be written as:
-%% \begin{equation}\label{StandardInversionParabola}
+%% \begin{equation}\label{StandardConjugateParabola}
%% (y-y0)^2=2p(x-x0)
%% \end{equation}
%% and the parametric function can be written as:
-%% \begin{equation}\label{ParametricFunctionOfStandardInversionParabola}
+%% \begin{equation}\label{ParametricFunctionOfStandardConjugateParabola}
%% \left\{\begin{array}{l}
%% x=\dfrac{t^2}{2p}+x_o\\
%% y=t+y_o
@@ -5976,7 +6044,7 @@
%% \end{equation}
%
%% \pstIParabola[Options](O){p}{y0}{y1}
-%% Draw a Inversion Parabola from y0 to y1 with Vertex O, the half of the focus chord axis $abs{p}$, the sign of $p$ indicates the direction of the parabola.
+%% Draw a Conjugate Parabola from y0 to y1 with Vertex O, the half of the focus chord axis $abs{p}$, the sign of $p$ indicates the direction of the parabola.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the parabola vertex O
@@ -6000,7 +6068,7 @@
}%
%
%% \pstIParabolaNode[Options](O){p}{t}{A}
-%% Draw the node whose paramater is the given value $t$ on the Inversion Parabola P.
+%% Draw the node whose paramater is the given value $t$ on the Conjugate Parabola P.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the parabola vertex O
@@ -6025,7 +6093,7 @@
}%
%
%% \pstIParabolaOrdNode[Options](O){p}{$y_1$}{A}
-%% Draw the node whose ordinate is the given value $y_1$ on the Inversion Parabola P.
+%% Draw the node whose ordinate is the given value $y_1$ on the Conjugate Parabola P.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the parabola vertex O
@@ -6048,7 +6116,7 @@
}%
%
%% \pstIParabolaAbsNode[Options](O){p}{$x_1$}{A}{B}
-%% Draw the nodes whose abscissa is the given value $x_1$ on the Inversion Parabola P.
+%% Draw the nodes whose abscissa is the given value $x_1$ on the Conjugate Parabola P.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the parabola vertex O
@@ -6088,7 +6156,7 @@
}%
%
%% \pstIParabolaFocusNode[Options](O){p}{F}
-%% Draw the focus node of a Inversion Parabola P.
+%% Draw the focus node of a Conjugate Parabola P.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the parabola vertex O
@@ -6111,7 +6179,7 @@
}%
%
%% \pstIParabolaDirectrixLine[Options](O){p}{LA}{LB}
-%% Draw the directrix line of a Inversion Parabola P.
+%% Draw the directrix line of a Conjugate Parabola P.
%% The node LA also lies on the symmetrical axis line, and node LB is another one on the directrix line.
%% Parameters:
%% #1 -> options
@@ -6146,7 +6214,7 @@
}%
%
%% \pstIParabolaLineInter[Options](O){p}{A}{B}{C}{D}
-%% Find the intersections C and D of line AB and the Inversion Parabola P.
+%% Find the intersections C and D of line AB and the Conjugate Parabola P.
%% We can represent the line AB as the following function when line AB is not vertical:
%% $$y=kx+t$$ where $$k=\dfrac{y_2-y_1}{x_2-x_1}, t=\dfrac{x_2y_1-x_1y_2}{x_2-x_1}$$
%% The intersections are:
@@ -6250,7 +6318,7 @@
}%
%
%% \pstIParabolaPolarNode[Options](O){p}(F)[L1][L2]{A}{B}{T}
-%% Find the polar point of chord AB on Inversion Parabola P.
+%% Find the polar point of chord AB on Conjugate Parabola P.
%% We use the following proposition to find the polar point of chord AB:
%% Give any chord AB, drawing two focal chord AFC and BFD, where F is the focus, then drawing FX which is perpendicular to AFC at point F, and intersect with the directrix line at X; also drawing FY which is perpendicular to BFD at point F, and intersect with the directrix line at Y. Then the intersection T of AX and BY is the polar point of chord AB.
%% If you don't know the focus F, or the directrix line, we will find them automated, otherwise you can pass them to this macro.
@@ -6295,7 +6363,7 @@
}%
%
%% \pstIParabolaTangentNode[Options](O){p}{T}{A}{B}
-%% Draw the two tangent lines through the point $T$ to the Inversion Parabola P and get the node A and B on the Inversion Parabola.
+%% Draw the two tangent lines through the point $T$ to the Conjugate Parabola P and get the node A and B on the Conjugate Parabola.
%% We use the following proposition to find the tangent node of T:
%% Give point T outside of the parabola, we draw any other two chords TPQ and TRS, PS and QR intersect at I, PR and QS intersect at X, XI and Parabola intersect at A and B, then TA is the tangent line through A and TB is the tangent line through B.
%% Parameters:
@@ -6467,21 +6535,22 @@
\pstParseArg{CurveCoef}{a,b,c,d,e,f}{#2}
\pnode(!
\CurveCoefa /CurveCoefa ED
- \CurveCoefb /CurveCoefb ED
+ \CurveCoefb\space 2 div /CurveCoefb ED
\CurveCoefc /CurveCoefc ED
- \CurveCoefd /CurveCoefd ED
- \CurveCoefe /CurveCoefe ED
+ \CurveCoefd\space 2 div /CurveCoefd ED
+ \CurveCoefe\space 2 div /CurveCoefe ED
\CurveCoeff /CurveCoeff ED
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
% I1=a+c
CurveCoefa CurveCoefc add /DiscriminantI ED
- % I2=b^2-4ac
- CurveCoefb dup mul 4 CurveCoefa CurveCoefc mul mul sub /DiscriminantII ED
- % I3=1/2|2a b d,b 2c e,d e 2f|
- CurveCoefa 2 mul CurveCoefb CurveCoefd
- CurveCoefb CurveCoefc 2 mul CurveCoefe
- CurveCoefd CurveCoefe CurveCoeff 2 mul
- tx@EcldDict begin DeterminantThree end 2 div /DiscriminantIII ED
- %DiscriminantI = DiscriminantII = DiscriminantIII =
+ % I2=ac-b^2
+ CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
+ % I3=|a b d,b c e,d e f|
+ CurveCoefa CurveCoefb CurveCoefd
+ CurveCoefb CurveCoefc CurveCoefe
+ CurveCoefd CurveCoefe CurveCoeff
+ tx@EcldDict begin DeterminantThree end /DiscriminantIII ED
+ % DiscriminantI = DiscriminantII = DiscriminantIII =
DiscriminantII abs 1E-5 lt DiscriminantIII 0 ne and { % if I2=0 and I3!=0
CurveCoefb abs 1E-5 lt { % b=0 -> sin2x=0 x=0
0 /#5 ED
@@ -6490,21 +6559,21 @@
45 /#5 ED
} {
CurveCoefb 0 lt {
- CurveCoefb neg CurveCoefc CurveCoefa sub atan /MyParabolaAngDbl ED
+ 2 CurveCoefb mul neg CurveCoefc CurveCoefa sub atan /MyParabolaAngDbl ED
MyParabolaAngDbl 2 div /#5 ED
} {
- CurveCoefb CurveCoefa CurveCoefc sub atan /MyParabolaAngDbl ED
+ 2 CurveCoefb mul CurveCoefa CurveCoefc sub atan /MyParabolaAngDbl ED
MyParabolaAngDbl 2 div /#5 ED
} ifelse
} ifelse
} ifelse
#5 sin /MySin ED #5 cos /MyCos ED
- CurveCoefa MyCos dup mul mul CurveCoefb MySin MyCos mul mul add
+ CurveCoefa MyCos dup mul mul 2 CurveCoefb mul MySin MyCos mul mul add
CurveCoefc MySin dup mul mul add /MyCoefa ED
- CurveCoefa MySin dup mul mul CurveCoefb MySin MyCos mul mul sub
+ CurveCoefa MySin dup mul mul 2 CurveCoefb mul MySin MyCos mul mul sub
CurveCoefc MyCos dup mul mul add /MyCoefc ED
- CurveCoefd MyCos mul CurveCoefe MySin mul add /MyCoefd ED
- CurveCoefe MyCos mul CurveCoefd MySin mul sub /MyCoefe ED
+ 2 CurveCoefd mul MyCos mul 2 CurveCoefe mul MySin mul add /MyCoefd ED
+ 2 CurveCoefe mul MyCos mul 2 CurveCoefd mul MySin mul sub /MyCoefe ED
MyCoefa abs 1E-5 lt { % a'=0
% c'y^2+d'x+e'y+f'=0
MyCoefd abs 1E-5 lt { % d'=0 two lines, not support
@@ -6517,7 +6586,7 @@
MyCoefe dup mul MyCoefc div MyCoefd div 4 div CurveCoeff MyCoefd div sub /MyVertexX ED
MyVertexX MyCos mul MyVertexY MySin mul sub
MyVertexY MyCos mul MyVertexX MySin mul add
- #5 90 sub /#5 ED % inverse general hyperbola
+ #5 90 sub /#5 ED % general conjugate hyperbola
} ifelse
} if
MyCoefc abs 1E-5 lt { % c'=0
@@ -6538,6 +6607,16 @@
%MyCoefa = MyCoefc = MyCoefd = MyCoefe =
%(--------------) =
} {
+ (These five points can not construct a parabola!) =
+ DiscriminantII abs 1E-5 lt DiscriminantIII abs 1E-5 lt and { % if I2=0 and I3=0
+ (May be they are two lines!) =
+ } {
+ DiscriminantII 0 gt {
+ (May be they can construct an ellipse!) =
+ } {
+ (May be they can construct a hyperbola!) =
+ } ifelse
+ } ifelse
0 /#4 ED
0 /#5 ED
0 0
@@ -6603,7 +6682,7 @@
CurveLineACCoefA CurveNodeEX mul CurveLineACCoefB CurveNodeEY mul add CurveLineACCoefC add /CurveValueACE ED % AC-E
CurveLineBDCoefA CurveNodeEX mul CurveLineBDCoefB CurveNodeEY mul add CurveLineBDCoefC add /CurveValueBDE ED % BD-E
% CurveValueABE = CurveValueCDE = CurveValueACE = CurveValueBDE =
- CurveValueACE CurveValueBDE mul dup abs 1E-5 lt { % lambda can be any number, the cuver is not unique defined.
+ CurveValueACE CurveValueBDE mul dup abs 1E-5 lt { % lambda can be any number, the curve is not unique defined.
0 /#8 ED
0 /#9 ED
0 0
@@ -6613,13 +6692,37 @@
% =(a1a2+ka3a4)x^2+(a2b1+a1b2+ka4b3+ka3b4)xy+(b1b2+kb3b4)y^2+(a2c1+a1c2+ka4c3+ka3c4)x+(b2c1+b1c2+kb4c3+kb3c4)y+c1c2+kc3c4
CurveLineABCoefA CurveLineCDCoefA mul CurveLineACCoefA CurveLineBDCoefA mul CurveLambda mul add /CurveCoefa ED
CurveLineCDCoefA CurveLineABCoefB mul CurveLineABCoefA CurveLineCDCoefB mul add
- CurveLineBDCoefA CurveLineACCoefB mul CurveLineACCoefA CurveLineBDCoefB mul add CurveLambda mul add /CurveCoefb ED
+ CurveLineBDCoefA CurveLineACCoefB mul CurveLineACCoefA CurveLineBDCoefB mul add CurveLambda mul add 2 div /CurveCoefb ED
CurveLineABCoefB CurveLineCDCoefB mul CurveLineACCoefB CurveLineBDCoefB mul CurveLambda mul add /CurveCoefc ED
CurveLineCDCoefA CurveLineABCoefC mul CurveLineABCoefA CurveLineCDCoefC mul add
- CurveLineBDCoefA CurveLineACCoefC mul CurveLineACCoefA CurveLineBDCoefC mul add CurveLambda mul add /CurveCoefd ED
+ CurveLineBDCoefA CurveLineACCoefC mul CurveLineACCoefA CurveLineBDCoefC mul add CurveLambda mul add 2 div /CurveCoefd ED
CurveLineCDCoefB CurveLineABCoefC mul CurveLineABCoefB CurveLineCDCoefC mul add
- CurveLineBDCoefB CurveLineACCoefC mul CurveLineACCoefB CurveLineBDCoefC mul add CurveLambda mul add /CurveCoefe ED
+ CurveLineBDCoefB CurveLineACCoefC mul CurveLineACCoefB CurveLineBDCoefC mul add CurveLambda mul add 2 div /CurveCoefe ED
CurveLineABCoefC CurveLineCDCoefC mul CurveLineACCoefC CurveLineBDCoefC mul CurveLambda mul add /CurveCoeff ED
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ 0 /CurveCoefMax ED 1E8 /CurveCoefMin ED
+ CurveCoefa abs CurveCoefMax gt {CurveCoefa abs /CurveCoefMax ED} if
+ CurveCoefb abs CurveCoefMax gt {CurveCoefb abs /CurveCoefMax ED} if
+ CurveCoefc abs CurveCoefMax gt {CurveCoefc abs /CurveCoefMax ED} if
+ CurveCoefd abs CurveCoefMax gt {CurveCoefd abs /CurveCoefMax ED} if
+ CurveCoefe abs CurveCoefMax gt {CurveCoefe abs /CurveCoefMax ED} if
+ CurveCoeff abs CurveCoefMax gt {CurveCoeff abs /CurveCoefMax ED} if
+ CurveCoefa abs CurveCoefMin lt {CurveCoefa abs /CurveCoefMin ED} if
+ CurveCoefb abs CurveCoefMin lt {CurveCoefb abs /CurveCoefMin ED} if
+ CurveCoefc abs CurveCoefMin lt {CurveCoefc abs /CurveCoefMin ED} if
+ CurveCoefd abs CurveCoefMin lt {CurveCoefd abs /CurveCoefMin ED} if
+ CurveCoefe abs CurveCoefMin lt {CurveCoefe abs /CurveCoefMin ED} if
+ CurveCoeff abs CurveCoefMin lt {CurveCoeff abs /CurveCoefMin ED} if
+ % CurveCoefMin = CurveCoefMax =
+ CurveCoefMin CurveCoefMax div 1E-5 lt {
+ CurveCoefa CurveCoefMax div /CurveCoefa ED
+ CurveCoefb CurveCoefMax div /CurveCoefb ED
+ CurveCoefc CurveCoefMax div /CurveCoefc ED
+ CurveCoefd CurveCoefMax div /CurveCoefd ED
+ CurveCoefe CurveCoefMax div /CurveCoefe ED
+ CurveCoeff CurveCoefMax div /CurveCoeff ED
+ } if
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
CurveCoefa abs 1E-5 lt {0 /CurveCoefa ED} if
CurveCoefb abs 1E-5 lt {0 /CurveCoefb ED} if
CurveCoefc abs 1E-5 lt {0 /CurveCoefc ED} if
@@ -6630,13 +6733,13 @@
% the following is same with pstGeneralParabolaCoef.
% I1=a+c
CurveCoefa CurveCoefc add /DiscriminantI ED
- % I2=b^2-4ac
- CurveCoefb dup mul 4 CurveCoefa CurveCoefc mul mul sub /DiscriminantII ED
- % I3=1/2|2a b d,b 2c e,d e 2f|
- CurveCoefa 2 mul CurveCoefb CurveCoefd
- CurveCoefb CurveCoefc 2 mul CurveCoefe
- CurveCoefd CurveCoefe CurveCoeff 2 mul
- tx@EcldDict begin DeterminantThree end 2 div /DiscriminantIII ED
+ % I2=ac-b^2
+ CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
+ % I3=|a b d,b c e,d e f|
+ CurveCoefa CurveCoefb CurveCoefd
+ CurveCoefb CurveCoefc CurveCoefe
+ CurveCoefd CurveCoefe CurveCoeff
+ tx@EcldDict begin DeterminantThree end /DiscriminantIII ED
% DiscriminantI = DiscriminantII = DiscriminantIII =
DiscriminantII abs 1E-5 lt DiscriminantIII 0 ne and { % if I2=0 and I3!=0
CurveCoefb abs 1E-5 lt { % b=0 -> sin2x=0 x=0
@@ -6646,21 +6749,21 @@
45 /#9 ED
} {
CurveCoefb 0 lt {
- CurveCoefb neg CurveCoefc CurveCoefa sub atan /MyParabolaAngDbl ED
+ 2 CurveCoefb mul neg CurveCoefc CurveCoefa sub atan /MyParabolaAngDbl ED
MyParabolaAngDbl 2 div /#9 ED
} {
- CurveCoefb CurveCoefa CurveCoefc sub atan /MyParabolaAngDbl ED
+ 2 CurveCoefb mul CurveCoefa CurveCoefc sub atan /MyParabolaAngDbl ED
MyParabolaAngDbl 2 div /#9 ED
} ifelse
} ifelse
} ifelse
#9 sin /MySin ED #9 cos /MyCos ED
- CurveCoefa MyCos dup mul mul CurveCoefb MySin MyCos mul mul add
+ CurveCoefa MyCos dup mul mul 2 CurveCoefb mul MySin MyCos mul mul add
CurveCoefc MySin dup mul mul add /MyCoefa ED
- CurveCoefa MySin dup mul mul CurveCoefb MySin MyCos mul mul sub
+ CurveCoefa MySin dup mul mul 2 CurveCoefb mul MySin MyCos mul mul sub
CurveCoefc MyCos dup mul mul add /MyCoefc ED
- CurveCoefd MyCos mul CurveCoefe MySin mul add /MyCoefd ED
- CurveCoefe MyCos mul CurveCoefd MySin mul sub /MyCoefe ED
+ 2 CurveCoefd mul MyCos mul 2 CurveCoefe mul MySin mul add /MyCoefd ED
+ 2 CurveCoefe mul MyCos mul 2 CurveCoefd mul MySin mul sub /MyCoefe ED
MyCoefa abs 1E-5 lt { % a'=0
% c'y^2+d'x+e'y+f'=0
MyCoefd abs 1E-5 lt { % d'=0 two lines, not support
@@ -6673,7 +6776,7 @@
MyCoefe dup mul MyCoefc div MyCoefd div 4 div CurveCoeff MyCoefd div sub /MyVertexX ED
MyVertexX MyCos mul MyVertexY MySin mul sub
MyVertexY MyCos mul MyVertexX MySin mul add
- #9 90 sub /#9 ED % inverse general hyperbola
+ #9 90 sub /#9 ED % general conjugate hyperbola
} ifelse
} if
MyCoefc abs 1E-5 lt { % c'=0
@@ -6693,10 +6796,14 @@
% #8 = #9 = MySin = MyCos = MyCoefa = MyCoefc = MyCoefd = MyCoefe = (--------------) =
} {
(These five points can not construct a parabola!) =
- DiscriminantII 0 lt {
- (May be they can construct an ellipse!) =
+ DiscriminantII abs 1E-5 lt DiscriminantIII abs 1E-5 lt and { % if I2=0 and I3=0
+ (May be they are two lines!) =
} {
- (May be they can construct a hyperbola!) =
+ DiscriminantII 0 gt {
+ (May be they can construct an ellipse!) =
+ } {
+ (May be they can construct a hyperbola!) =
+ } ifelse
} ifelse
0 /#8 ED
0 /#9 ED
@@ -7198,12 +7305,12 @@
\endgroup%
}%
%
-% 6. General Inversion Parabola with coordinate translation and rotation
+% 6. General Conjugate Parabola with coordinate translation and rotation
%% ----------------------------------------------------------
-%% The General Inversion Parabola P is defined by vertex O, the half of the focus chord axis $abs(p)$, the sign of $p$ indicates the direction of the parabola,
+%% The General Conjugate Parabola P is defined by vertex O, 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 equation can be got from the parametric function of the inversion parabola \ref{ParametricFunctionOfStandardInversionParabola},
+%% The equation can be got from the parametric function of the conjugate parabola \ref{ParametricFunctionOfStandardConjugateParabola},
%% using the rotation transform formula \ref{RotationTransformFormula}, then we have
%% \begin{equation}
%% \left\{\begin{array}{l}
@@ -7212,8 +7319,8 @@
%% \end{array}\right.
%% \end{equation}
%% where the $x_o'$ and $y_o'$ are the coordinate of the given vertex O after rotation.
-%% So we get the parametric function of the General Inversion Parabola with coordinate translation and rotation as following:
-%% \begin{equation}\label{ParametricFunctionOfGeneralInversionParabola}
+%% So we get the parametric function of the General Conjugate Parabola with coordinate translation and rotation as following:
+%% \begin{equation}\label{ParametricFunctionOfGeneralConjugateParabola}
%% \left\{\begin{array}{l}
%% x=x_o-t\sin\theta+t^2\dfrac{\cos\theta}{2p}\\
%% y=y_o+t\cos\theta+t^2\dfrac{\sin\theta}{2p}
@@ -7221,7 +7328,7 @@
%% \end{equation}
%
%% \pstGeneralIParabola[Options](O){p}[rotation]{y0}{y1}
-%% Draw a General Inversion Parabola from y0 to y1 with Vertex O, the half of the focus chord axis $p$,
+%% Draw a General Conjugate Parabola from y0 to y1 with Vertex O, the half of the focus chord axis $p$,
%% and the rotation angle $\theta$ of the symmetrical axis.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% Parameters:
@@ -7255,7 +7362,7 @@
}%
%
%% \pstGeneralIParabolaNode[Options](O){p}[rotation]{t}{A}
-%% Create a new node $A$ whose parameter is the the given value $t$ on the given General Inversion Parabola P.
+%% Create a new node $A$ whose parameter is the the given value $t$ on the given General Conjugate Parabola P.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% Parameters:
%% #1 -> options
@@ -7289,7 +7396,7 @@
}%
%
%% \pstGeneralIParabolaAbsNode[Options](O){p}[rotation]{x_1}{A}{B}
-%% Find the nodes $A$ and $B$ whose abscissa are the the given value $x_1$ on the given General Inversion Parabola P.
+%% Find the nodes $A$ and $B$ whose abscissa are the the given value $x_1$ on the given General Conjugate Parabola P.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% when $x=x_1$, we have
%% $$t^2\dfrac{\cos\theta}{2p}-t\sin\theta-(x_1-x_o)=0$$
@@ -7358,7 +7465,7 @@
}%
%
%% \pstGeneralIParabolaOrdNode[Options](O){p}[rotation]{y_1}{A}{B}
-%% Find the nodes $A$ and $B$ whose ordinate are the the given value $y_1$ on the given General Inversion Parabola P.
+%% Find the nodes $A$ and $B$ whose ordinate are the the given value $y_1$ on the given General Conjugate Parabola P.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% when $y=y_1$, we have
%% $$t^2\dfrac{\sin\theta}{2p}+t\cos\theta-(y_1-y_o)=0$$
@@ -7429,7 +7536,7 @@
}%
%
%% \pstGeneralIParabolaFocusNode[Options](O){p}[rotation]{F}
-%% Find the focus node $F$ of the given General Inversion Parabola P.
+%% Find the focus node $F$ of the given General Conjugate Parabola P.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% Parameters:
%% #1 -> options
@@ -7458,7 +7565,7 @@
}%
%
%% \pstGeneralIParabolaDirectrixLine[Options](O){p}[rotation]{LA}{LB}
-%% Draw the directrix line of the General Inversion Parabola P.
+%% Draw the directrix line of the General Conjugate Parabola P.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% The node LA also lies on the symmetrical axis line, and node LB is another one on the directrix line.
%% they can be got after the orig nodes rotation $\theta$ about the vertex $O$,
@@ -7520,7 +7627,7 @@
%%
%% Case 2. When line AB is not vertical, we can represent the line AB as the following function:
%% $$y=kx+d$$ where $$k=\dfrac{y_2-y_1}{x_2-x_1}, d=\dfrac{x_2y_1-x_1y_2}{x_2-x_1}$$
-%% refer to equation (\ref{ParametricFunctionOfGeneralInversionParabola}), we have
+%% refer to equation (\ref{ParametricFunctionOfGeneralConjugateParabola}), we have
%% $$ft^2+2pet-2pm=0$$
%% where
%% $$m=kx_o-y_o+d,e=\cos\theta+k\sin\theta,f=\sin\theta-k\cos\theta$$
@@ -7668,7 +7775,7 @@
}%
%
%% \pstGeneralIParabolaPolarNode[Options](O){p}[rotation](F)[L1][L2]{A}{B}{T}
-%% Find the polar point of chord AB on General Inversion Parabola P.
+%% Find the polar point of chord AB on General Conjugate Parabola P.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% We use the following proposition to find the polar point of chord AB:
%% Give any chord AB, drawing two focal chord AFC and BFD, where F is the focus, then drawing FX which is perpendicular to AFC at point F, and intersect with the directrix line at X; also drawing FY which is perpendicular to BFD at point F, and intersect with the directrix line at Y. Then the intersection T of AX and BY is the polar point of chord AB.
@@ -7718,7 +7825,7 @@
}%
%
%% \pstGeneralIParabolaTangentNode[Options](O){p}[rotation]{T}{A}{B}
-%% Draw the two tangent lines through the point $T$ to the General Inversion Parabola P and get the node A and B on the General Inversion Parabola.
+%% Draw the two tangent lines through the point $T$ to the General Conjugate Parabola P and get the node A and B on the General Conjugate Parabola.
%% We use the following proposition to find the tangent node of T:
%% Give point T outside of the parabola, we draw any other two chords TPQ and TRS, PS and QR intersect at I, PR and QS intersect at X, XI and GeneralIParabola intersect at A and B, then TA is the tangent line through A and TB is the tangent line through B.
%% Parameters:
@@ -8251,15 +8358,15 @@
\endgroup%
}%
%
-% 8. Standard Inversion Hyperbola with coordinate translation
+% 8. Standard Conjugate Hyperbola with coordinate translation
%% ----------------------------------------------------------
-%% The Standard Inversion Hyperbola H is defined by center O, the half of the real axis $a$, the half of the imaginary axis $b$.
+%% The Standard Conjugate Hyperbola H is defined by center O, the half of the real axis $a$, the half of the imaginary axis $b$.
%% The equation can be written as:
-%% \begin{equation}\label{FunctionOfStandardInversionHyperbola}
+%% \begin{equation}\label{FunctionOfStandardConjugateHyperbola}
%% \dfrac{(y-y0)^2}{a^2}-\dfrac{(x-x0)^2}{b^2}=1
%% \end{equation}
%% and the parametric function can be written as:
-%% \begin{equation}\label{ParametricFunctionOfStandardInversionHyperbola}
+%% \begin{equation}\label{ParametricFunctionOfStandardConjugateHyperbola}
%% \left\{\begin{array}{l}
%% x=b\tan\alpha+x_o\\
%% y=a\sec\alpha+y_o
@@ -8267,7 +8374,7 @@
%% \end{equation}
%
%% \pstIHyperbola[Options](O)(a,b)[maxAngleY]
-%% Draw a Inversion Hyperbola with center O, the half of the real axis $abs(a)$, and the half of the imaginary axis $abs(b)$.
+%% Draw a Conjugate Hyperbola with center O, the half of the real axis $abs(a)$, and the half of the imaginary axis $abs(b)$.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -8320,7 +8427,7 @@
}%
%
%% \pstIHyperbolaNode[Options](O)(a,b){t}{P}
-%% Create a new node P on the Inversion Hyperbola E whose parameter is the given value $t$.
+%% Create a new node P on the Conjugate Hyperbola E whose parameter is the given value $t$.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -8350,7 +8457,7 @@
}%
%
%% \pstIHyperbolaAbsNode[Options](O)(a,b){x_1}{A}{B}
-%% Create a new node P on the Inversion Hyperbola E whose abscissa is the given value $x_1$.
+%% Create a new node P on the Conjugate Hyperbola E whose abscissa is the given value $x_1$.
%% when $x=x_1$, we have
%% $$\dfrac{(y-y_0)^2}{a^2}-\dfrac{(x_1-x_0)^2}{b^2}=1$$
%% $$(y-y_0)^2=\dfrac{a^2(x_1-x_0)^2+a^2b^2}{b^2}$$
@@ -8389,7 +8496,7 @@
}%
%
%% \pstIHyperbolaOrdNode[Options](O)(a,b){y_1}{A}{B}
-%% Create a new node P on the Inversion Hyperbola E whose ordinate is the given value $y_1$.
+%% Create a new node P on the Conjugate Hyperbola E whose ordinate is the given value $y_1$.
%% when $y=y_1$, we have
%% $$\dfrac{(y_1-y_0)^2}{a^2}-\dfrac{(x-x_0)^2}{b^2}=1$$
%% $$(x-x_0)^2=\dfrac{b^2(y_1-y_0)^2-a^2b^2}{a^2}$$
@@ -8436,7 +8543,7 @@
}%
%
%% \pstIHyperbolaFocusNode[Options](O)(a,b){F1}{F2}
-%% Create the two focus node F1 and F2 of the Inversion Hyperbola H.
+%% Create the two focus node F1 and F2 of the Conjugate Hyperbola H.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -8470,7 +8577,7 @@
}%
%
%% \pstIHyperbolaDirectrixLine[Options](O)(a,b){Lx}{Ly}{Rx}{Ry}
-%% Draw the two directrix lines L1 and L2 of the Inversion Hyperbola H.
+%% Draw the two directrix lines L1 and L2 of the Conjugate Hyperbola H.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -8524,7 +8631,7 @@
}%
%
%% \pstIHyperbolaAsymptoteLine[Options](O)(a,b){L1}{L2}
-%% Draw the two asymptote lines L1 and L2 of the Inversion Hyperbola H.
+%% Draw the two asymptote lines L1 and L2 of the Conjugate Hyperbola H.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -8562,14 +8669,14 @@
}%
%
%% \pstIHyperbolaLineInter[Options](O)(a,b){A}{B}{C}{D}
-%% Find the two intersection nodes C and D of the Inversion Hyperbola H and line AB.
+%% Find the two intersection nodes C and D of the Conjugate Hyperbola H and line AB.
%%
%% Case 1. When line AB is vertical, i.e, $x_1=x_2$, we have
%% $$y=y_0\pm\dfrac{a}{b}\sqrt{(x_1-x_0)^2+b^2}$$
%%
%% Case 2. When line AB is not vertical, we can represent the line AB as the following function:
%% $$y=kx+d$$ where $$k=\dfrac{y_2-y_1}{x_2-x_1}, d=\dfrac{x_2y_1-x_1y_2}{x_2-x_1}$$
-%% refer to equation (\ref{FunctionOfStandardInversionHyperbola}), we have
+%% refer to equation (\ref{FunctionOfStandardConjugateHyperbola}), we have
%% $$(b^2k^2-a^2)X^2+2b^2kmX+b^2(m^2-a^2)=0$$
%% $$Y=kX+m$$
%% where
@@ -8684,7 +8791,7 @@
}%
%
%% \pstIHyperbolaPolarNode[Options](O)(a,b){A}{B}{T}
-%% Find the polar point of chord AB on Inversion Hyperbola H.
+%% Find the polar point of chord AB on Conjugate Hyperbola H.
%% We use the following proposition to find the polar point of chord AB:
%% Let $P$, $Q$ are vertex points of the hyperbola, for any chord $AB$ of hyperbola, $PA$ and $BQ$ intersect at $E$, $PB$ and $AQ$ intersect at $F$, then the middle point $M$ of $EF$ is the polar point of chord $AB$.
%% Parameters:
@@ -8709,7 +8816,7 @@
}%
%
%% \pstIHyperbolaTangentNode[Options](O)(a,b){T}{A}{B}
-%% Draw the two tangent lines through the point $T$ to the Inversion Hyperbola H and get the node A and B on the Inversion Hyperbola.
+%% Draw the two tangent lines through the point $T$ to the Conjugate Hyperbola H and get the node A and B on the Conjugate Hyperbola.
%% We use the following proposition to find the tangent points $A$ and $B$ of $T$:
%% Let $T$ is a point out of the hyperbola, we give any two chords $TPQ$ and $TRS$ of the hyperbola, $PR$ and $QS$ intersect at $X$, $RQ$ and $PS$ intersect at $Y$,
%% then the intersection point $A$ and $B$ of $XY$ and the hyperbola are the tangent points from $T$.
@@ -8830,7 +8937,7 @@
%% #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
+%% #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.
@@ -8850,9 +8957,9 @@
Fax Fay Fbx Fby
tx@EcldDict begin ABDist end
2 div /HyperbolaC ED
- Nx Ny Fax Fay
+ Nx Ny Fax Fay
tx@EcldDict begin ABDist end
- Nx Ny Fbx Fby
+ 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
@@ -8965,7 +9072,7 @@
%% #2 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
%% #3 -> [output] the center of the hyperbola.
%% #4 -> [output] the pair of real and imaginary radius of the hyperbola.
-%% #5 -> [output] the rotation of the hyperbola symmetrical axis.
+%% #5 -> [output] the rotation of the hyperbola real symmetrical axis.
\def\pstGeneralHyperbolaCoef{\@ifnextchar[\Pst@GeneralHyperbolaCoef{\Pst@GeneralHyperbolaCoef[]}}
\def\Pst@GeneralHyperbolaCoef[#1]#2#3#4#5{
\begingroup
@@ -8973,24 +9080,25 @@
\pstParseArg{CurveCoef}{a,b,c,d,e,f}{#2}
\pnode(!
\CurveCoefa /CurveCoefa ED
- \CurveCoefb /CurveCoefb ED
+ \CurveCoefb\space 2 div /CurveCoefb ED
\CurveCoefc /CurveCoefc ED
- \CurveCoefd /CurveCoefd ED
- \CurveCoefe /CurveCoefe ED
+ \CurveCoefd\space 2 div /CurveCoefd ED
+ \CurveCoefe\space 2 div /CurveCoefe ED
\CurveCoeff /CurveCoeff ED
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
% I1=a+c
CurveCoefa CurveCoefc add /DiscriminantI ED
- % I2=b^2-4ac
- CurveCoefb dup mul 4 CurveCoefa CurveCoefc mul mul sub /DiscriminantII ED
- % I3=1/2|2a b d,b 2c e,d e 2f|
- CurveCoefa 2 mul CurveCoefb CurveCoefd
- CurveCoefb CurveCoefc 2 mul CurveCoefe
- CurveCoefd CurveCoefe CurveCoeff 2 mul
- tx@EcldDict begin DeterminantThree end 2 div /DiscriminantIII ED
+ % I2=ac-b^2
+ CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
+ % I3=|a b d,b c e,d e f|
+ CurveCoefa CurveCoefb CurveCoefd
+ CurveCoefb CurveCoefc CurveCoefe
+ CurveCoefd CurveCoefe CurveCoeff
+ tx@EcldDict begin DeterminantThree end /DiscriminantIII ED
% DiscriminantI = DiscriminantII = DiscriminantIII =
- DiscriminantII 0 gt DiscriminantIII 0 ne and { % if I2>0 and I3!=0
- % Solve the Characteristic Equation: \lambda^2-I_1\lambda-I_2/4=0
- DiscriminantI dup mul DiscriminantII add dup 0 lt {
+ DiscriminantII 0 lt DiscriminantIII 0 ne and { % if I2<0 and I3!=0
+ % Solve the Characteristic Equation: \lambda^2-I_1\lambda+I_2=0
+ DiscriminantI dup mul 4 DiscriminantII mul sub dup 0 lt {
0 0
0 /MyHyperbolaA ED
0 /MyHyperbolaB ED
@@ -8999,55 +9107,34 @@
sqrt dup DiscriminantI exch sub 2 div /CharacteristicLambdaI ED
DiscriminantI add 2 div /CharacteristicLambdaII ED
% CharacteristicLambdaI = CharacteristicLambdaII =
- CurveCoefb 0 lt {
- DiscriminantIII 0 lt {
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div sqrt /MyHyperbolaA ED
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- } {
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div sqrt /MyHyperbolaA ED
- } ifelse
- } {
- DiscriminantIII 0 lt {
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div sqrt /MyHyperbolaA ED
- } {
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div sqrt /MyHyperbolaA ED
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- } ifelse
- } ifelse
- CurveCoefb abs 1E-5 lt { % b == 0
- CurveCoefa CurveCoefc lt { % a < c
- 0 /#5 ED
+ % 20200726 Liaoxiongfei
+ % fix how to get the rotation of the hyperbola real symmetrical axis.
+ % since we can reduce the hyperbola to
+ % \lambda_1x^2+\lambda_2y^2+I_3/I_2=0
+ % and $I_2\leq0$, so the real symmetrical axis is determined by the characteristic root with the same sign as I3.
+ % and the slope of real symmetrical axis is $(\lambda_1-a)/b$, or $(c-\lambda_2)/b$, where $\lambda_1*I_3>0$, or they have same sign.
+ DiscriminantIII CharacteristicLambdaI mul 0 gt {
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyHyperbolaA ED
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div sqrt /MyHyperbolaB ED
+ CharacteristicLambdaI CurveCoefa lt {
+ CharacteristicLambdaI CurveCoefa sub neg CurveCoefb neg atan /#5 ED
} {
- 90 /#5 ED
+ CharacteristicLambdaI CurveCoefa sub CurveCoefb atan /#5 ED
} ifelse
} {
- CurveCoefa CurveCoefc sub abs 1E-5 lt { % a = c
- 45 /#5 ED
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyHyperbolaA ED
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div sqrt /MyHyperbolaB ED
+ CharacteristicLambdaII CurveCoefa lt {
+ CharacteristicLambdaII CurveCoefa sub neg CurveCoefb neg atan /#5 ED
} {
- DiscriminantIII 0 lt {
- CurveCoefb 0 lt {
- CurveCoefb neg CurveCoefc CurveCoefa sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 2 div /#5 ED
- } {
- CurveCoefb CurveCoefa CurveCoefc sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 180 add 2 div /#5 ED
- } ifelse
- } {
- CurveCoefb 0 lt {
- CurveCoefb neg CurveCoefc CurveCoefa sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 180 add 2 div /#5 ED
- } {
- CurveCoefb CurveCoefa CurveCoefc sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 2 div /#5 ED
- } ifelse
- } ifelse
+ CharacteristicLambdaII CurveCoefa sub CurveCoefb atan /#5 ED
} ifelse
} ifelse
% MyHyperbolaA = MyHyperbolaB = #5 = (--------------) =
- CurveCoefd CurveCoefc mul 2 mul CurveCoefb CurveCoefe mul sub DiscriminantII div % x0
- CurveCoefa CurveCoefe mul 2 mul CurveCoefb CurveCoefd mul sub DiscriminantII div % y0
+ % F_1(x,y)=ax+by+d=0
+ % F_2(x,y)=bx+cy+e=0
+ CurveCoefb CurveCoefe mul CurveCoefc CurveCoefd mul sub DiscriminantII div % x0
+ CurveCoefb CurveCoefd mul CurveCoefa CurveCoefe mul sub DiscriminantII div % y0
} ifelse
} {
0 0
@@ -9096,19 +9183,19 @@
\pst@CurveNodeD \tx@UserCoor /CurveNodeDY ED /CurveNodeDX ED
\pst@CurveNodeE \tx@UserCoor /CurveNodeEY ED /CurveNodeEX ED
%%
- % ax^2+bxy+cy^2+dx+ey+f=0, let a=1, we can use A,B,C,D,E to solve b,c,d,e,f, we have
- % AxAy b + Ay^2 c + Ax d + Ay e + 1 f = -Ax^2
- % BxBy b + By^2 c + Bx d + By e + 1 f = -Bx^2
- % CxCy b + Cy^2 c + Cx d + Cy e + 1 f = -Cx^2
- % DxDy b + Dy^2 c + Dx d + Dy e + 1 f = -Dx^2
- % ExEy b + Ey^2 c + Ex d + Ey e + 1 f = -Ex^2
+ % ax^2+bxy+cy^2+dx+ey+f=0, we can use A,B,C,D,E to solve b,c,d,e,f, we have
+ % AxAy b + Ay^2 c + Ax d + Ay e + 1 f = -Ax^2a
+ % BxBy b + By^2 c + Bx d + By e + 1 f = -Bx^2a
+ % CxCy b + Cy^2 c + Cx d + Cy e + 1 f = -Cx^2a
+ % DxDy b + Dy^2 c + Dx d + Dy e + 1 f = -Dx^2a
+ % ExEy b + Ey^2 c + Ex d + Ey e + 1 f = -Ex^2a
% by Cramer's Rule, we have
- % |Ax^2 Ay^2 Ax Ay 1| |AxAy Ay^2 Ax Ay 1|
- % |Bx^2 By^2 Bx By 1| |BxBy By^2 Bx By 1|
- % b=-|Cx^2 Cy^2 Cx Cy 1|/|CxCy Cy^2 Cx Cy 1| etc.
- % |Dx^2 Dy^2 Dx Dy 1| |DxDy Dy^2 Dx Dy 1|
- % |Ex^2 Ey^2 Ex Ey 1| |ExEy Ey^2 Ex Ey 1|
- %%
+ % |Ax^2a Ay^2 Ax Ay 1| |AxAy Ay^2 Ax Ay 1|
+ % |Bx^2a By^2 Bx By 1| |BxBy By^2 Bx By 1|
+ % b=-|Cx^2a Cy^2 Cx Cy 1|/|CxCy Cy^2 Cx Cy 1| etc.
+ % |Dx^2a Dy^2 Dx Dy 1| |DxDy Dy^2 Dx Dy 1|
+ % |Ex^2a Ey^2 Ex Ey 1| |ExEy Ey^2 Ex Ey 1|
+ % if the denominator is zero, we can choose a = 0, else a = 1.
CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX CurveNodeBY 1
CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX CurveNodeCY 1
@@ -9116,10 +9203,52 @@
CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY 1
tx@EcldDict begin DeterminantFive end /LinearDiscriminant ED
LinearDiscriminant abs 1E-5 lt { % D=0
- 0 0
- 0 /MyHyperbolaA ED
- 0 /MyHyperbolaB ED
- 0 /#9 ED
+ 0 /CurveCoefa ED
+ % Ay^2 c + Ax d + Ay e + 1 f = -AxAyb
+ % By^2 c + Bx d + By e + 1 f = -BxByb
+ % Cy^2 c + Cx d + Cy e + 1 f = -CxCyb
+ % Dy^2 c + Dx d + Dy e + 1 f = -DxDyb
+ % by Cramer's Rule, we have
+ % |AxAyb Ax Ay 1| |Ay^2 Ax Ay 1|
+ % |BxByb Bx By 1| |By^2 Bx By 1|
+ % c=-|CxCyb Cx Cy 1|/|Cy^2 Cx Cy 1| etc.
+ % |DxDyb Dx Dy 1| |Dy^2 Dx Dy 1|
+ % if the denominator is zero, then b = 0, but I_2 is zero at this time,
+ % and the equation is not a hyperbola. so we can choose b = 1.
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDY 1
+ tx@EcldDict begin DeterminantFour end /LinearDiscriminant2nd ED
+ LinearDiscriminant2nd abs 1E-5 lt { % D2=0
+ 0 /CurveCoefb ED
+ 0 /CurveCoefc ED
+ 0 /CurveCoefd ED
+ 0 /CurveCoefe ED
+ 0 /CurveCoeff ED
+ } {
+ 1 2 div /CurveCoefb ED
+ CurveNodeAX CurveNodeAY mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBX CurveNodeBY mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCX CurveNodeCY mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDX CurveNodeDY mul CurveNodeDX CurveNodeDY 1
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg /CurveCoefc ED
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAY mul CurveNodeAY 1
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBY mul CurveNodeBY 1
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCY mul CurveNodeCY 1
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDY mul CurveNodeDY 1
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg 2 div /CurveCoefd ED
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAX CurveNodeAY mul 1
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBX CurveNodeBY mul 1
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCX CurveNodeCY mul 1
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDX CurveNodeDY mul 1
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg 2 div /CurveCoefe ED
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAY CurveNodeAX CurveNodeAY mul
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBY CurveNodeBX CurveNodeBY mul
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCY CurveNodeCX CurveNodeCY mul
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDY CurveNodeDX CurveNodeDY mul
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg /CurveCoeff ED
+ } ifelse
} {
1 /CurveCoefa ED
CurveNodeAX dup mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
@@ -9127,7 +9256,7 @@
CurveNodeCX dup mul CurveNodeCY dup mul CurveNodeCX CurveNodeCY 1
CurveNodeDX dup mul CurveNodeDY dup mul CurveNodeDX CurveNodeDY 1
CurveNodeEX dup mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY 1
- tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefb ED
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg 2 div /CurveCoefb ED
CurveNodeAX CurveNodeAY mul CurveNodeAX dup mul CurveNodeAX CurveNodeAY 1
CurveNodeBX CurveNodeBY mul CurveNodeBX dup mul CurveNodeBX CurveNodeBY 1
CurveNodeCX CurveNodeCY mul CurveNodeCX dup mul CurveNodeCX CurveNodeCY 1
@@ -9139,97 +9268,107 @@
CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX dup mul CurveNodeCY 1
CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX dup mul CurveNodeDY 1
CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX dup mul CurveNodeEY 1
- tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefd ED
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg 2 div /CurveCoefd ED
CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX CurveNodeAX dup mul 1
CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX CurveNodeBX dup mul 1
CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX CurveNodeCX dup mul 1
CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX CurveNodeDX dup mul 1
CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEX dup mul 1
- tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefe ED
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg 2 div /CurveCoefe ED
CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY CurveNodeAX dup mul
CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX CurveNodeBY CurveNodeBX dup mul
CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX CurveNodeCY CurveNodeCX dup mul
CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX CurveNodeDY CurveNodeDX dup mul
CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY CurveNodeEX dup mul
tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoeff ED
- % the following is same with pstGeneralHyperbolaCoef.
- % I1=a+c
- CurveCoefa CurveCoefc add /DiscriminantI ED
- % I2=b^2-4ac
- CurveCoefb dup mul 4 CurveCoefa CurveCoefc mul mul sub /DiscriminantII ED
- % I3=1/2|2a b d,b 2c e,d e 2f|
- CurveCoefa 2 mul CurveCoefb CurveCoefd
- CurveCoefb CurveCoefc 2 mul CurveCoefe
- CurveCoefd CurveCoefe CurveCoeff 2 mul
- tx@EcldDict begin DeterminantThree end 2 div /DiscriminantIII ED
- % DiscriminantI = DiscriminantII = DiscriminantIII =
- DiscriminantII 0 gt DiscriminantIII 0 ne and { % if I2>0 and I3!=0
- % Solve the Characteristic Equation: \lambda^2-I_1\lambda-I_2/4=0
- DiscriminantI dup mul DiscriminantII add dup 0 lt {
- 0 0
- 0 /MyHyperbolaA ED
- 0 /MyHyperbolaB ED
- 0 /#9 ED
- } {
- sqrt dup DiscriminantI exch sub 2 div /CharacteristicLambdaI ED
- DiscriminantI add 2 div /CharacteristicLambdaII ED
- % CharacteristicLambdaI = CharacteristicLambdaII =
- CurveCoefb 0 lt {
- DiscriminantIII 0 lt {
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div sqrt /MyHyperbolaA ED
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- } {
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div sqrt /MyHyperbolaA ED
- } ifelse
+ } ifelse
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ 0 /CurveCoefMax ED 1E8 /CurveCoefMin ED
+ CurveCoefa abs CurveCoefMax gt {CurveCoefa abs /CurveCoefMax ED} if
+ CurveCoefb abs CurveCoefMax gt {CurveCoefb abs /CurveCoefMax ED} if
+ CurveCoefc abs CurveCoefMax gt {CurveCoefc abs /CurveCoefMax ED} if
+ CurveCoefd abs CurveCoefMax gt {CurveCoefd abs /CurveCoefMax ED} if
+ CurveCoefe abs CurveCoefMax gt {CurveCoefe abs /CurveCoefMax ED} if
+ CurveCoeff abs CurveCoefMax gt {CurveCoeff abs /CurveCoefMax ED} if
+ CurveCoefa abs CurveCoefMin lt {CurveCoefa abs /CurveCoefMin ED} if
+ CurveCoefb abs CurveCoefMin lt {CurveCoefb abs /CurveCoefMin ED} if
+ CurveCoefc abs CurveCoefMin lt {CurveCoefc abs /CurveCoefMin ED} if
+ CurveCoefd abs CurveCoefMin lt {CurveCoefd abs /CurveCoefMin ED} if
+ CurveCoefe abs CurveCoefMin lt {CurveCoefe abs /CurveCoefMin ED} if
+ CurveCoeff abs CurveCoefMin lt {CurveCoeff abs /CurveCoefMin ED} if
+ % CurveCoefMin = CurveCoefMax =
+ CurveCoefMin CurveCoefMax div 1E-5 lt {
+ CurveCoefa CurveCoefMax div /CurveCoefa ED
+ CurveCoefb CurveCoefMax div /CurveCoefb ED
+ CurveCoefc CurveCoefMax div /CurveCoefc ED
+ CurveCoefd CurveCoefMax div /CurveCoefd ED
+ CurveCoefe CurveCoefMax div /CurveCoefe ED
+ CurveCoeff CurveCoefMax div /CurveCoeff ED
+ } if
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ CurveCoefa abs 1E-5 lt {0 /CurveCoefa ED} if
+ CurveCoefb abs 1E-5 lt {0 /CurveCoefb ED} if
+ CurveCoefc abs 1E-5 lt {0 /CurveCoefc ED} if
+ CurveCoefd abs 1E-5 lt {0 /CurveCoefd ED} if
+ CurveCoefe abs 1E-5 lt {0 /CurveCoefe ED} if
+ CurveCoeff abs 1E-5 lt {0 /CurveCoeff ED} if
+ % the following is same with pstGeneralHyperbolaCoef.
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ % I1=a+c
+ CurveCoefa CurveCoefc add /DiscriminantI ED
+ % I2=ac-b^2
+ CurveCoefa CurveCoefc mul CurveCoefb dup mul sub /DiscriminantII ED
+ % I3=|a b d,b c e,d e f|
+ CurveCoefa CurveCoefb CurveCoefd
+ CurveCoefb CurveCoefc CurveCoefe
+ CurveCoefd CurveCoefe CurveCoeff
+ tx@EcldDict begin DeterminantThree end /DiscriminantIII ED
+ % DiscriminantI = DiscriminantII = DiscriminantIII =
+ DiscriminantII 0 lt DiscriminantIII 0 ne and { % if I2<0 and I3!=0
+ % Solve the Characteristic Equation: \lambda^2-I_1\lambda+I_2=0
+ DiscriminantI dup mul 4 DiscriminantII mul sub dup 0 lt {
+ 0 0
+ 0 /MyHyperbolaA ED
+ 0 /MyHyperbolaB ED
+ 0 /#9 ED
+ } {
+ sqrt dup DiscriminantI exch sub 2 div /CharacteristicLambdaI ED
+ DiscriminantI add 2 div /CharacteristicLambdaII ED
+ % CharacteristicLambdaI = CharacteristicLambdaII =
+ % 20200726 Liaoxiongfei
+ % fix how to get the rotation of the hyperbola real symmetrical axis.
+ % since we can reduce the hyperbola to
+ % \lambda_1x^2+\lambda_2y^2+I_3/I_2=0
+ % and $I_2\leq0$, so the real symmetrical axis is determined by the characteristic root with the same sign as I3.
+ % and the slope of real symmetrical axis is $(\lambda_1-a)/b$, or $(c-\lambda_2)/b$, where $\lambda_1*I_3>0$, or they have same sign.
+ DiscriminantIII CharacteristicLambdaI mul 0 gt {
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyHyperbolaA ED
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div sqrt /MyHyperbolaB ED
+ CharacteristicLambdaI CurveCoefa lt {
+ CharacteristicLambdaI CurveCoefa sub neg CurveCoefb neg atan /#9 ED
} {
- DiscriminantIII 0 lt {
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div sqrt /MyHyperbolaA ED
- } {
- DiscriminantIII CharacteristicLambdaII DiscriminantII mul div sqrt /MyHyperbolaA ED
- DiscriminantIII CharacteristicLambdaI DiscriminantII mul div neg sqrt /MyHyperbolaB ED
- } ifelse
+ CharacteristicLambdaI CurveCoefa sub CurveCoefb atan /#9 ED
} ifelse
- CurveCoefb abs 1E-5 lt { % b == 0
- CurveCoefa CurveCoefc lt { % a < c
- 0 /#9 ED
- } {
- 90 /#9 ED
- } ifelse
+ } {
+ DiscriminantIII CharacteristicLambdaII DiscriminantII mul div neg sqrt /MyHyperbolaA ED
+ DiscriminantIII CharacteristicLambdaI DiscriminantII mul div sqrt /MyHyperbolaB ED
+ CharacteristicLambdaII CurveCoefa lt {
+ CharacteristicLambdaII CurveCoefa sub neg CurveCoefb neg atan /#9 ED
} {
- CurveCoefa CurveCoefc sub abs 1E-5 lt { % a = c
- 45 /#9 ED
- } {
- DiscriminantIII 0 lt {
- CurveCoefb 0 lt {
- CurveCoefb neg CurveCoefc CurveCoefa sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 2 div /#9 ED
- } {
- CurveCoefb CurveCoefa CurveCoefc sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 180 add 2 div /#9 ED
- } ifelse
- } {
- CurveCoefb 0 lt {
- CurveCoefb neg CurveCoefc CurveCoefa sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 180 add 2 div /#9 ED
- } {
- CurveCoefb CurveCoefa CurveCoefc sub atan /MyHyperbolaAngDbl ED
- MyHyperbolaAngDbl 2 div /#9 ED
- } ifelse
- } ifelse
- } ifelse
+ CharacteristicLambdaII CurveCoefa sub CurveCoefb atan /#9 ED
} ifelse
- % MyHyperbolaA = MyHyperbolaB = #9 = (--------------) =
- CurveCoefd CurveCoefc mul 2 mul CurveCoefb CurveCoefe mul sub DiscriminantII div % x0
- CurveCoefa CurveCoefe mul 2 mul CurveCoefb CurveCoefd mul sub DiscriminantII div % y0
} ifelse
- } {
- 0 0
- 0 /MyHyperbolaA ED
- 0 /MyHyperbolaB ED
- 0 /#9 ED
+ % MyHyperbolaA = MyHyperbolaB = #9 = (--------------) =
+ % F_1(x,y)=ax+by+d=0
+ % F_2(x,y)=bx+cy+e=0
+ CurveCoefb CurveCoefe mul CurveCoefc CurveCoefd mul sub DiscriminantII div % x0
+ CurveCoefb CurveCoefd mul CurveCoefa CurveCoefe mul sub DiscriminantII div % y0
} ifelse
+ } {
+ 0 0
+ 0 /MyHyperbolaA ED
+ 0 /MyHyperbolaB ED
+ 0 /#9 ED
} ifelse
){#7}
\Pst@geonodelabel{#7}%
@@ -9982,11 +10121,11 @@
\endgroup%
}%
%
-% 10. General Inversion Hyperbola with coordinate translation and rotation
+% 10. General Conjugate Hyperbola with coordinate translation and rotation
%% ----------------------------------------------------------
-%% The General Inversion Hyperbola H is defined by center O, the half of the real axis $a$, the half of the imaginary axis $b$,
+%% The General Conjugate Hyperbola H is defined by center O, the half of the real axis $a$, the half of the imaginary axis $b$,
%% and the rotation angle $\theta$ of the principal axis.
-%% The equation can be got from the parametric function of the Standard Inversion Hyperbola \ref{ParametricFunctionOfStandardInversionHyperbola},
+%% The equation can be got from the parametric function of the Standard Conjugate Hyperbola \ref{ParametricFunctionOfStandardConjugateHyperbola},
%% using the rotation transform formula \ref{RotationTransformFormula}, then we have
%% \begin{equation}
%% \left\{\begin{array}{l}
@@ -9995,8 +10134,8 @@
%% \end{array}\right.
%% \end{equation}
%% where the $x_o'$ and $y_o'$ are the coordinate of the given center O after rotation.
-%% So we get the parametric function of the General Inversion Hyperbola with coordinate translation and rotation as following:
-%% \begin{equation}\label{ParametricFunctionOfGeneralInversionHyperbola}
+%% So we get the parametric function of the General Conjugate Hyperbola with coordinate translation and rotation as following:
+%% \begin{equation}\label{ParametricFunctionOfGeneralConjugateHyperbola}
%% \left\{\begin{array}{l}
%% x=x_o+b\tan\alpha\cos\theta-a\sec\alpha\sin\theta\\
%% y=y_o+b\tan\alpha\sin\theta+a\sec\alpha\cos\theta
@@ -10004,7 +10143,7 @@
%% \end{equation}
%
%% \pstGeneralIHyperbola[Options](O)(a,b)[rotation][maxAngleX]
-%% Draw a General Inversion Hyperbola with center O, the half of the real axis $abs(a)$, the half of the imaginary axis $abs(b)$,
+%% Draw a General Conjugate Hyperbola with center O, the half of the real axis $abs(a)$, the half of the imaginary axis $abs(b)$,
%% and the rotation angle $\theta$ of the symmetrical axis.
%% Parameters:
%% #1 -> options
@@ -10067,7 +10206,7 @@
}%
%
%% \pstGeneralIHyperbolaNode[Options](O)(a,b)[rotation]{t}{A}
-%% Draw a node whose parameter value is the given value t on the General Inversion Hyperbola.
+%% Draw a node whose parameter value is the given value t on the General Conjugate Hyperbola.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -10105,7 +10244,7 @@
}%
%
%% \pstGeneralIHyperbolaAbsNode[Options](O)(a,b)[rotation]{x_1}{A}{B}
-%% Draw the nodes whose abscissa value are the given value x_1 on the General Inversion Hyperbola.
+%% Draw the nodes whose abscissa value are the given value x_1 on the General Conjugate Hyperbola.
%%
%% set $e=a\cos\theta$, $f=b\sin\theta$, $g=a\sin\theta$, $h=b\cos\theta$, then we have
%% $$x=x_0+h\tan\alpha-g\sec\alpha, y=y_0+f\tan\alpha+e\sec\alpha$$
@@ -10215,7 +10354,7 @@
}%
%
%% \pstGeneralIHyperbolaOrdNode[Options](O)(a,b)[rotation]{y_1}{A}{B}
-%% Draw the nodes whose ordinate value are the given value y_1 on the General Inversion Hyperbola.
+%% Draw the nodes whose ordinate value are the given value y_1 on the General Conjugate Hyperbola.
%%
%% set $e=a\cos\theta$, $f=b\sin\theta$, $g=a\sin\theta$, $h=b\cos\theta$, then we have
%% $$x=x_0+h\tan\alpha-g\sec\alpha, y=y_0+f\tan\alpha+e\sec\alpha$$
@@ -10325,7 +10464,7 @@
}%
%
%% \pstGeneralIHyperbolaFocusNode[Options](O)(a,b)[rotation]{F1}{F2}
-%% Draw the focus nodes of the General Inversion Hyperbola H.
+%% Draw the focus nodes of the General Conjugate Hyperbola H.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% Parameters:
%% #1 -> options
@@ -10367,7 +10506,7 @@
}%
%
%% \pstGeneralIHyperbolaVertexNode[Options](O)(a,b)[rotation]{V1}{V2}
-%% Draw the vertex nodes of the General Inversion Hyperbola H.
+%% Draw the vertex nodes of the General Conjugate Hyperbola H.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% Parameters:
%% #1 -> options
@@ -10407,7 +10546,7 @@
}%
%
%% \pstGeneralIHyperbolaDirectrixLine[Options](O)(a,b)[rotation]{Lx}{Ly}{Rx}{Ry}
-%% Draw the two directrix lines of the General Inversion Hyperbola H.
+%% Draw the two directrix lines of the General Conjugate Hyperbola H.
%% If you not input the rotation angle, the default value is $0^\circ$.
%% Parameters:
%% #1 -> options
@@ -10481,7 +10620,7 @@
}%
%
%% \pstGeneralIHyperbolaAsymptoteLine[Options](O)(a,b)[rotation]{L1}{L2}
-%% Draw the two asymptote lines L1 and L2 of the General Inversion Hyperbola H.
+%% Draw the two asymptote lines L1 and L2 of the General Conjugate Hyperbola H.
%% Parameters:
%% #1 -> options
%% #2 -> [input] the hyperbola center O
@@ -10532,7 +10671,7 @@
%
%
%% \pstGeneralIHyperbolaLineInter[Options](O)(a,b)[rotation]{A}{B}{C}{D}
-%% Find the intersection nodes $C$ and $D$ of the given line AB with the General Inversion Hyperbola H.
+%% Find the intersection nodes $C$ and $D$ of the given line AB with the General Conjugate Hyperbola H.
%%
%% set $e=a\cos\theta$, $f=b\sin\theta$, $g=a\sin\theta$, $h=b\cos\theta$, then we have
%% $$x=x_0+h\tan\alpha-g\sec\alpha, y=y_0+f\tan\alpha+e\sec\alpha$$
@@ -10742,7 +10881,7 @@
}%
%
%% \pstGeneralIHyperbolaPolarNode[Options](O)(a,b)[rotation]{A}{B}{T}
-%% Find the polar point of chord AB on General Inversion Hyperbola H.
+%% Find the polar point of chord AB on General Conjugate Hyperbola H.
%% We use the following proposition to find the polar point of chord AB:
%% Let $P$, $Q$ are vertex points of the hyperbola, for any chord $AB$ of hyperbola, $PA$ and $BQ$ intersect at $E$, $PB$ and $AQ$ intersect at $F$, then the middle point $M$ of $EF$ is the polar point of chord $AB$.
%% Parameters:
@@ -10772,7 +10911,7 @@
}%
%
%% \pstGeneralIHyperbolaTangentNode[Options](O)(a,b)[rotation]{T}{A}{B}
-%% Draw the two tangent lines through the point $T$ to the General Inversion Hyperbola H and get the node A and B on the General Inversion Hyperbola.
+%% Draw the two tangent lines through the point $T$ to the General Conjugate Hyperbola H and get the node A and B on the General Conjugate Hyperbola.
%% We use the following proposition to find the tangent points $A$ and $B$ of $T$:
%% Let $T$ is a point out of the hyperbola, we give any two chords $TPQ$ and $TRS$ of the hyperbola, $PR$ and $QS$ intersect at $X$, $RQ$ and $PS$ intersect at $Y$,
%% then the intersection point $A$ and $B$ of $XY$ and the hyperbola are the tangent points from $T$.
@@ -10807,6 +10946,968 @@
\endgroup%
}%
%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% 11. General Conic Equation ax^2+bxy+cy^2+dx+ey+f=0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%% \pstGeneralConicEquation[Options]{A}{B}{C}{D}{E}{a,b,c,d,e,f}
+%% Calculate the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$ which through five different points A,B,C,D,E.
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the given point A.
+%% #3 -> [input] the given point B.
+%% #4 -> [input] the given point C.
+%% #5 -> [input] the given point D.
+%% #6 -> [input] the given point E.
+%% #7 -> [output] the output coefficents name a,b,c,d,e,f of quadratic equation.
+\def\pstGeneralConicEquation{\@ifnextchar[\Pst@GeneralConicEquation{\Pst@GeneralConicEquation[]}}
+\def\Pst@GeneralConicEquation[#1]#2#3#4#5#6#7{
+ \begingroup
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@CurveNodeA%
+ \pst@getcoor{#3}\pst@CurveNodeB%
+ \pst@getcoor{#4}\pst@CurveNodeC%
+ \pst@getcoor{#5}\pst@CurveNodeD%
+ \pst@getcoor{#6}\pst@CurveNodeE%
+ \pstParseArg{OutCurveCoef}{a,b,c,d,e,f}{#7}
+ \pnode(!
+ \pst@CurveNodeA \tx@UserCoor /CurveNodeAY ED /CurveNodeAX ED
+ \pst@CurveNodeB \tx@UserCoor /CurveNodeBY ED /CurveNodeBX ED
+ \pst@CurveNodeC \tx@UserCoor /CurveNodeCY ED /CurveNodeCX ED
+ \pst@CurveNodeD \tx@UserCoor /CurveNodeDY ED /CurveNodeDX ED
+ \pst@CurveNodeE \tx@UserCoor /CurveNodeEY ED /CurveNodeEX ED
+ %%
+ % ax^2+bxy+cy^2+dx+ey+f=0, we can use A,B,C,D,E to solve b,c,d,e,f, we have
+ % AxAy b + Ay^2 c + Ax d + Ay e + 1 f = -Ax^2a
+ % BxBy b + By^2 c + Bx d + By e + 1 f = -Bx^2a
+ % CxCy b + Cy^2 c + Cx d + Cy e + 1 f = -Cx^2a
+ % DxDy b + Dy^2 c + Dx d + Dy e + 1 f = -Dx^2a
+ % ExEy b + Ey^2 c + Ex d + Ey e + 1 f = -Ex^2a
+ % by Cramer's Rule, we have
+ % |Ax^2a Ay^2 Ax Ay 1| |AxAy Ay^2 Ax Ay 1|
+ % |Bx^2a By^2 Bx By 1| |BxBy By^2 Bx By 1|
+ % b=-|Cx^2a Cy^2 Cx Cy 1|/|CxCy Cy^2 Cx Cy 1| etc.
+ % |Dx^2a Dy^2 Dx Dy 1| |DxDy Dy^2 Dx Dy 1|
+ % |Ex^2a Ey^2 Ex Ey 1| |ExEy Ey^2 Ex Ey 1|
+ % if the denominator is zero, we can choose a = 0, else a = 1.
+ CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX CurveNodeDY 1
+ CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY 1
+ tx@EcldDict begin DeterminantFive end /LinearDiscriminant ED
+ LinearDiscriminant abs 1E-5 lt { % D=0
+ 0 /CurveCoefa ED
+ % Ay^2 c + Ax d + Ay e + 1 f = -AxAyb
+ % By^2 c + Bx d + By e + 1 f = -BxByb
+ % Cy^2 c + Cx d + Cy e + 1 f = -CxCyb
+ % Dy^2 c + Dx d + Dy e + 1 f = -DxDyb
+ % by Cramer's Rule, we have
+ % |AxAyb Ax Ay 1| |Ay^2 Ax Ay 1|
+ % |BxByb Bx By 1| |By^2 Bx By 1|
+ % c=-|CxCyb Cx Cy 1|/|Cy^2 Cx Cy 1| etc.
+ % |DxDyb Dx Dy 1| |Dy^2 Dx Dy 1|
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDY 1
+ tx@EcldDict begin DeterminantFour end /LinearDiscriminant2nd ED
+ LinearDiscriminant2nd abs 1E-5 lt { % D2=0
+ 0 /CurveCoefb ED
+ % Ax d + Ay e + 1 f = -Ay^2c
+ % Bx d + By e + 1 f = -By^2c
+ % Cx d + Cy e + 1 f = -Cy^2c
+ % by Cramer's Rule, we have
+ % d=-|Ay^2c Ay 1| |Ax Ay 1|
+ % |By^2c By 1| |Bx By 1|
+ % |Cy^2c Cy 1|/|Cx Cy 1| etc.
+ CurveNodeAX CurveNodeAY 1
+ CurveNodeBX CurveNodeBY 1
+ CurveNodeCX CurveNodeCY 1
+ tx@EcldDict begin DeterminantThree end /LinearDiscriminant3rd ED
+ LinearDiscriminant3rd abs 1E-5 lt { % D3=0
+ 0 /CurveCoefc ED
+ % Ay e + 1 f = -Axd
+ % By e + 1 f = -Bxd
+ CurveNodeAY 1
+ CurveNodeBY 1
+ tx@EcldDict begin DeterminantTwo end /LinearDiscriminant4th ED
+ LinearDiscriminant4th abs 1E-5 lt { % D4=0
+ 0 /CurveCoefd ED
+ 1 /CurveCoefe ED
+ CurveNodeAY neg /CurveCoeff ED
+ } {
+ 1 /CurveCoefd ED
+ CurveNodeAX 1
+ CurveNodeBX 1
+ tx@EcldDict begin DeterminantTwo end LinearDiscriminant4th div neg /CurveCoefe ED
+ CurveNodeAY CurveNodeAX
+ CurveNodeBY CurveNodeBX
+ tx@EcldDict begin DeterminantTwo end LinearDiscriminant4th div neg /CurveCoeff ED
+ } ifelse
+ } {
+ 1 /CurveCoefc ED
+ CurveNodeAY dup mul CurveNodeAY 1
+ CurveNodeBY dup mul CurveNodeBY 1
+ CurveNodeCY dup mul CurveNodeCY 1
+ tx@EcldDict begin DeterminantThree end LinearDiscriminant3rd div neg /CurveCoefd ED
+ CurveNodeAX CurveNodeAY dup mul 1
+ CurveNodeBX CurveNodeBY dup mul 1
+ CurveNodeCX CurveNodeCY dup mul 1
+ tx@EcldDict begin DeterminantThree end LinearDiscriminant3rd div neg /CurveCoefe ED
+ CurveNodeAX CurveNodeAY CurveNodeAY dup mul
+ CurveNodeBX CurveNodeBY CurveNodeBY dup mul
+ CurveNodeCX CurveNodeCY CurveNodeCY dup mul
+ tx@EcldDict begin DeterminantThree end LinearDiscriminant3rd div neg /CurveCoeff ED
+ } ifelse
+ } {
+ 1 /CurveCoefb ED
+ CurveNodeAX CurveNodeAY mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBX CurveNodeBY mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCX CurveNodeCY mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDX CurveNodeDY mul CurveNodeDX CurveNodeDY 1
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg /CurveCoefc ED
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAY mul CurveNodeAY 1
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBY mul CurveNodeBY 1
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCY mul CurveNodeCY 1
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDY mul CurveNodeDY 1
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg /CurveCoefd ED
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAX CurveNodeAY mul 1
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBX CurveNodeBY mul 1
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCX CurveNodeCY mul 1
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDX CurveNodeDY mul 1
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg /CurveCoefe ED
+ CurveNodeAY dup mul CurveNodeAX CurveNodeAY CurveNodeAX CurveNodeAY mul
+ CurveNodeBY dup mul CurveNodeBX CurveNodeBY CurveNodeBX CurveNodeBY mul
+ CurveNodeCY dup mul CurveNodeCX CurveNodeCY CurveNodeCX CurveNodeCY mul
+ CurveNodeDY dup mul CurveNodeDX CurveNodeDY CurveNodeDX CurveNodeDY mul
+ tx@EcldDict begin DeterminantFour end LinearDiscriminant2nd div neg /CurveCoeff ED
+ } ifelse
+ } {
+ 1 /CurveCoefa ED
+ CurveNodeAX dup mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBX dup mul CurveNodeBY dup mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCX dup mul CurveNodeCY dup mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDX dup mul CurveNodeDY dup mul CurveNodeDX CurveNodeDY 1
+ CurveNodeEX dup mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY 1
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefb ED
+ CurveNodeAX CurveNodeAY mul CurveNodeAX dup mul CurveNodeAX CurveNodeAY 1
+ CurveNodeBX CurveNodeBY mul CurveNodeBX dup mul CurveNodeBX CurveNodeBY 1
+ CurveNodeCX CurveNodeCY mul CurveNodeCX dup mul CurveNodeCX CurveNodeCY 1
+ CurveNodeDX CurveNodeDY mul CurveNodeDX dup mul CurveNodeDX CurveNodeDY 1
+ CurveNodeEX CurveNodeEY mul CurveNodeEX dup mul CurveNodeEX CurveNodeEY 1
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefc ED
+ CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX dup mul CurveNodeAY 1
+ CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX dup mul CurveNodeBY 1
+ CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX dup mul CurveNodeCY 1
+ CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX dup mul CurveNodeDY 1
+ CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX dup mul CurveNodeEY 1
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefd ED
+ CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX CurveNodeAX dup mul 1
+ CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX CurveNodeBX dup mul 1
+ CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX CurveNodeCX dup mul 1
+ CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX CurveNodeDX dup mul 1
+ CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEX dup mul 1
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoefe ED
+ CurveNodeAX CurveNodeAY mul CurveNodeAY dup mul CurveNodeAX CurveNodeAY CurveNodeAX dup mul
+ CurveNodeBX CurveNodeBY mul CurveNodeBY dup mul CurveNodeBX CurveNodeBY CurveNodeBX dup mul
+ CurveNodeCX CurveNodeCY mul CurveNodeCY dup mul CurveNodeCX CurveNodeCY CurveNodeCX dup mul
+ CurveNodeDX CurveNodeDY mul CurveNodeDY dup mul CurveNodeDX CurveNodeDY CurveNodeDX dup mul
+ CurveNodeEX CurveNodeEY mul CurveNodeEY dup mul CurveNodeEX CurveNodeEY CurveNodeEX dup mul
+ tx@EcldDict begin DeterminantFive end LinearDiscriminant div neg /CurveCoeff ED
+ } ifelse
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ 0 /CurveCoefMax ED 1E8 /CurveCoefMin ED
+ CurveCoefa abs CurveCoefMax gt {CurveCoefa abs /CurveCoefMax ED} if
+ CurveCoefb abs CurveCoefMax gt {CurveCoefb abs /CurveCoefMax ED} if
+ CurveCoefc abs CurveCoefMax gt {CurveCoefc abs /CurveCoefMax ED} if
+ CurveCoefd abs CurveCoefMax gt {CurveCoefd abs /CurveCoefMax ED} if
+ CurveCoefe abs CurveCoefMax gt {CurveCoefe abs /CurveCoefMax ED} if
+ CurveCoeff abs CurveCoefMax gt {CurveCoeff abs /CurveCoefMax ED} if
+ CurveCoefa abs CurveCoefMin lt {CurveCoefa abs /CurveCoefMin ED} if
+ CurveCoefb abs CurveCoefMin lt {CurveCoefb abs /CurveCoefMin ED} if
+ CurveCoefc abs CurveCoefMin lt {CurveCoefc abs /CurveCoefMin ED} if
+ CurveCoefd abs CurveCoefMin lt {CurveCoefd abs /CurveCoefMin ED} if
+ CurveCoefe abs CurveCoefMin lt {CurveCoefe abs /CurveCoefMin ED} if
+ CurveCoeff abs CurveCoefMin lt {CurveCoeff abs /CurveCoefMin ED} if
+ % CurveCoefMin = CurveCoefMax =
+ CurveCoefMin CurveCoefMax div 1E-5 lt {
+ CurveCoefa CurveCoefMax div /CurveCoefa ED
+ CurveCoefb CurveCoefMax div /CurveCoefb ED
+ CurveCoefc CurveCoefMax div /CurveCoefc ED
+ CurveCoefd CurveCoefMax div /CurveCoefd ED
+ CurveCoefe CurveCoefMax div /CurveCoefe ED
+ CurveCoeff CurveCoefMax div /CurveCoeff ED
+ } if
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ CurveCoefa abs 1E-5 lt {0 /CurveCoefa ED} if
+ CurveCoefb abs 1E-5 lt {0 /CurveCoefb ED} if
+ CurveCoefc abs 1E-5 lt {0 /CurveCoefc ED} if
+ CurveCoefd abs 1E-5 lt {0 /CurveCoefd ED} if
+ CurveCoefe abs 1E-5 lt {0 /CurveCoefe ED} if
+ CurveCoeff abs 1E-5 lt {0 /CurveCoeff ED} if
+ % CurveCoefa = CurveCoefb = CurveCoefc = CurveCoefd = CurveCoefe = CurveCoeff =
+ CurveCoefa /\OutCurveCoefa\space ED
+ CurveCoefb /\OutCurveCoefb\space ED
+ CurveCoefc /\OutCurveCoefc\space ED
+ CurveCoefd /\OutCurveCoefd\space ED
+ CurveCoefe /\OutCurveCoefe\space ED
+ CurveCoeff /\OutCurveCoeff\space ED
+ \ifPst@CodeFig
+ [\OutCurveCoefa\space \OutCurveCoefb\space \OutCurveCoefc\space \OutCurveCoefd\space \OutCurveCoefe\space \OutCurveCoeff\space] ==
+ \fi
+ 0 0
+ ){@Pst@GeneralConicEquationDummyNode}
+ \endgroup%
+}%
+%
+%% \pstGeneralEllipseEquation[Options](O)(a,b)[rotation]{a,b,c,d,e,f}
+%% Calculate the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$ for the given general ellipse.
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the ellipse center O
+%% #3 -> [input] the horizontal and vertical radii
+%% #4 -> [input] the rotation angle $\theta$ of the major axis.
+%% #5 -> [output] the output coefficents name a,b,c,d,e,f of quadratic equation.
+\def\pstGeneralEllipseEquation{\@ifnextchar[\Pst@GeneralEllipseEquation{\Pst@GeneralEllipseEquation[]}}
+\def\Pst@GeneralEllipseEquation[#1](#2)(#3){%
+ \begingroup
+ \psset{#1}%
+ \def\PST@EllipseCenter{#2}%
+ \def\PST@EllipseRadii{#3}%
+ \@ifnextchar[\Pst@GeneralEllipseEquation@i{\Pst@GeneralEllipseEquation@i[0]}}%
+\def\Pst@GeneralEllipseEquation@i[#1]#2{%
+ \pstGeneralEllipseNode[PointName=none,PointSymbol=none](\PST@EllipseCenter)(\PST@EllipseRadii)[#1]{0}{@PST@EllipseTmpNodeA}
+ \pstGeneralEllipseNode[PointName=none,PointSymbol=none](\PST@EllipseCenter)(\PST@EllipseRadii)[#1]{90}{@PST@EllipseTmpNodeB}
+ \pstGeneralEllipseNode[PointName=none,PointSymbol=none](\PST@EllipseCenter)(\PST@EllipseRadii)[#1]{180}{@PST@EllipseTmpNodeC}
+ \pstGeneralEllipseNode[PointName=none,PointSymbol=none](\PST@EllipseCenter)(\PST@EllipseRadii)[#1]{270}{@PST@EllipseTmpNodeD}
+ \pstGeneralEllipseNode[PointName=none,PointSymbol=none](\PST@EllipseCenter)(\PST@EllipseRadii)[#1]{45}{@PST@EllipseTmpNodeE}
+ \pstGeneralConicEquation{@PST@EllipseTmpNodeA}{@PST@EllipseTmpNodeB}{@PST@EllipseTmpNodeC}{@PST@EllipseTmpNodeD}{@PST@EllipseTmpNodeE}{#2}
+ \endgroup%
+}%
+%
+%% \pstGeneralHyperbolaEquation[Options](O)(a,b)[rotation]{a,b,c,d,e,f}
+%% Calculate the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$ for the given general hyperbola.
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the hyperbola vertex O
+%% #3 -> [input] the radii of real and imaginary axis
+%% #4 -> [input] the rotation angle $\theta$ of the symmetrical axis.
+%% #5 -> [output] the output coefficents name a,b,c,d,e,f of quadratic equation.
+\def\pstGeneralHyperbolaEquation{\@ifnextchar[\Pst@GeneralHyperbolaEquation{\Pst@GeneralHyperbolaEquation[]}}
+\def\Pst@GeneralHyperbolaEquation[#1](#2)(#3){%
+ \begingroup
+ \psset{#1}%
+ \def\PST@HyperbolaCenter{#2}%
+ \def\PST@HyperbolaRadii{#3}%
+ \@ifnextchar[\Pst@GeneralHyperbolaEquation@i{\Pst@GeneralHyperbolaEquation@i[0]}}%
+\def\Pst@GeneralHyperbolaEquation@i[#1]#2{%
+ \pstGeneralHyperbolaVertexNode[PointName=none,PointSymbol=none](\PST@HyperbolaCenter)(\PST@HyperbolaRadii)[#1]{@PST@HyperbolaTmpNodeA}{@PST@HyperbolaTmpNodeB}
+ \pstGeneralHyperbolaNode[PointName=none,PointSymbol=none](\PST@HyperbolaCenter)(\PST@HyperbolaRadii)[#1]{10}{@PST@HyperbolaTmpNodeC}
+ \pstGeneralHyperbolaNode[PointName=none,PointSymbol=none](\PST@HyperbolaCenter)(\PST@HyperbolaRadii)[#1]{-10}{@PST@HyperbolaTmpNodeD}
+ \pstGeneralHyperbolaNode[PointName=none,PointSymbol=none](\PST@HyperbolaCenter)(\PST@HyperbolaRadii)[#1]{100}{@PST@HyperbolaTmpNodeE}
+ \pstGeneralConicEquation{@PST@HyperbolaTmpNodeA}{@PST@HyperbolaTmpNodeB}{@PST@HyperbolaTmpNodeC}{@PST@HyperbolaTmpNodeD}{@PST@HyperbolaTmpNodeE}{#2}
+ \endgroup%
+}%
+%
+%% \pstGeneralParabolaEquation[Options](O){p}[rotation]{a,b,c,d,e,f}
+%% Calculate the quadratic curve equation $ax^2+bxy+cy^2+dx+ey+f=0$ for the given general Parabola.
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the Parabola vertex O
+%% #3 -> [input] the half of focal chord $p$
+%% #4 -> [input] the rotation angle $\theta$ of the symmetrical axis.
+%% #5 -> [output] the output coefficents name a,b,c,d,e,f of quadratic equation.
+\def\pstGeneralParabolaEquation{\@ifnextchar[\Pst@GeneralParabolaEquation{\Pst@GeneralParabolaEquation[]}}
+\def\Pst@GeneralParabolaEquation[#1](#2)#3{%
+ \begingroup
+ \psset{#1}%
+ \def\PST@ParabolaVertex{#2}%
+ \def\PST@ParabolaSemiFocalChord{#3}%
+ \@ifnextchar[\Pst@GeneralParabolaEquation@i{\Pst@GeneralParabolaEquation@i[0]}}%
+\def\Pst@GeneralParabolaEquation@i[#1]#2{%
+ \pstGeneralParabolaNode[PointName=none,PointSymbol=none](\PST@ParabolaVertex){\PST@ParabolaSemiFocalChord}[#1]{0}{@PST@ParabolaTmpNodeA}
+ \pstGeneralParabolaNode[PointName=none,PointSymbol=none](\PST@ParabolaVertex){\PST@ParabolaSemiFocalChord}[#1]{90}{@PST@ParabolaTmpNodeB}
+ \pstGeneralParabolaNode[PointName=none,PointSymbol=none](\PST@ParabolaVertex){\PST@ParabolaSemiFocalChord}[#1]{180}{@PST@ParabolaTmpNodeC}
+ \pstGeneralParabolaNode[PointName=none,PointSymbol=none](\PST@ParabolaVertex){\PST@ParabolaSemiFocalChord}[#1]{270}{@PST@ParabolaTmpNodeD}
+ \pstGeneralParabolaNode[PointName=none,PointSymbol=none](\PST@ParabolaVertex){\PST@ParabolaSemiFocalChord}[#1]{45}{@PST@ParabolaTmpNodeE}
+ \pstGeneralConicEquation{@PST@ParabolaTmpNodeA}{@PST@ParabolaTmpNodeB}{@PST@ParabolaTmpNodeC}{@PST@ParabolaTmpNodeD}{@PST@ParabolaTmpNodeE}{#2}
+ \endgroup%
+}%
+%
+%% \pstGeneralConicLineInter[Options]{A}{B}{a,b,c,d,e,f}{C}{D}
+%% Get the two intersections $C$ and $D$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ with the given line $AB$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the node name A on the given line
+%% #3 -> [input] the node name B on the given line
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+\def\pstGeneralConicLineInter{\@ifnextchar[\Pst@GeneralConicLineInter{\Pst@GeneralConicLineInter[]}}
+\def\Pst@GeneralConicLineInter[#1]#2#3#4#5#6{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempA%
+ \pst@getcoor{#3}\pst@tempB%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Line ax+by+c=0
+ \pst@tempA \tx@UserCoor /Ay ED /Ax ED
+ \pst@tempB \tx@UserCoor /By ED /Bx ED
+ By Ay sub /La ED
+ Ax Bx sub /Lb ED
+ Ay Bx mul Ax By mul sub /Lc ED
+ La abs 1E-5 lt { % La==0
+ Lb abs 1E-5 lt { % Lb==0
+ 0 0
+ 0 /Dx ED 0 /Dy ED
+ } {
+ % Quadratic equation ax^2+bx+c=0
+ Ca Lb mul /Qa ED % Qa = Ca.Lb
+ Cd Lb mul Cb Lc mul sub /Qb ED % Qb = Cd.Lb-Cb.Lc
+ Cf Lb mul Ce Lc mul sub Cc Lc mul Lc mul Lb div add /Qc ED % Qc = Cf.Lb-Ce.Lc+Cc.Lc.Lc/Lb
+ Qa abs 1E-5 lt { % Qa==0
+ Qb abs 1E-5 lt { % Qb==0
+ 0 0
+ 0 /Dx ED 0 /Dy ED
+ } {
+ Qc Qb div neg % Cx
+ Lc Lb div neg % Cy
+ 0 /Dx ED 0 /Dy ED
+ } ifelse
+ } {
+ Qb dup mul Qa Qc mul 4 mul sub dup 0 lt { % Delta < 0
+ 0 0
+ 0 /Dx ED 0 /Dy ED
+ } {
+ sqrt dup Qb neg add Qa 2 mul div /Dx ED
+ Lc Lb div neg /Dy ED
+ Qb neg exch sub Qa 2 mul div % Cx
+ Lc Lb div neg % Cy
+ } ifelse
+ } ifelse
+ } ifelse
+ } {
+ % Quadratic equation ay^2+by+c=0
+ Ca Lb mul Lb mul La div Cc La mul add Cb Lb mul sub /Qa ED % Qa = Ca.Lb.Lb/La+Cc.La-Cb.Lb
+ Ca Lb mul Lc mul 2 mul La div Ce La mul add Cb Lc mul sub Cd Lb mul sub /Qb ED % Qb = 2.Ca.Lb.Lc/La+Ce.La-Cb.Lc-Cd.Lb
+ Ca Lc mul Lc mul La div Cf La mul add Cd Lc mul sub /Qc ED % Qc = Ca.Lc.Lc/La+Cf.La-Cd.LC
+ % Ca = Cb = Cc = Cd = Ce = Cf =
+ % La = Lb = Lc = Qa = Qb = Qc =
+ Qa abs 1E-5 lt { % Qa==0
+ Qb abs 1E-5 lt { % Qb==0
+ 0 0
+ 0 /Dx ED 0 /Dy ED
+ } {
+ Qc Qb div neg % Cy
+ dup Lb mul Lc add La div neg % Cx
+ exch % Cx Cy
+ 0 /Dx ED 0 /Dy ED
+ } ifelse
+ } {
+ Qb dup mul Qa Qc mul 4 mul sub dup 0 lt { % Delta < 0
+ 0 0
+ 0 /Dx ED 0 /Dy ED
+ } {
+ sqrt dup Qb neg add Qa 2 mul div /Dy ED
+ Dy Lb mul Lc add La div neg /Dx ED
+ Qb neg exch sub Qa 2 mul div % Cy
+ dup Lb mul Lc add La div neg % Cx
+ exch % Cx Cy
+ } ifelse
+ } ifelse
+ } ifelse
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicCircleInter[Options]{O}{A}{a,b,c,d,e,f}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and the given circle $O$ with radius $OA$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the center O of the given circle
+%% #3 -> [input] the node A on the given circle
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+%% #7 -> [output] the third intersection node name
+%% #8 -> [output] the fourth intersection node name
+\def\pstGeneralConicCircleInter{\@ifnextchar[\Pst@GeneralConicCircleInter{\Pst@GeneralConicCircleInter[]}}
+\def\Pst@GeneralConicCircleInter[#1]#2#3#4#5#6#7#8{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempO%
+ \pst@getcoor{#3}\pst@tempA%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Circle
+ \pst@tempO \tx@UserCoor /Oy ED /Ox ED
+ \pst@tempA \tx@UserCoor /Ay ED /Ax ED
+ /Rc Ax Ox sub dup mul Ay Oy sub dup mul add sqrt def
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf Ox Oy Rc ConicCircleInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \pnode(! Ex Ey){#7}
+ \pnode(! Fx Fy){#8}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \Pst@ManageParamList{#8}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicEllipseInter[Options](O)(m,n){a,b,c,d,e,f}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and the given ellipse $(x-O_x)^2/m^2+(y-O_y)^2/n^2=1$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the center O of the given ellipse
+%% #3 -> [input] the radius (m,n) of the given ellipse
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+%% #7 -> [output] the third intersection node name
+%% #8 -> [output] the fourth intersection node name
+\def\pstGeneralConicEllipseInter{\@ifnextchar[\Pst@GeneralConicEllipseInter{\Pst@GeneralConicEllipseInter[]}}
+\def\Pst@GeneralConicEllipseInter[#1](#2)(#3)#4#5#6#7#8{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempO%
+ \pst@getcoor{#3}\pst@tempR%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Ellipse
+ \pst@tempO \tx@UserCoor /Oy ED /Ox ED
+ \pst@tempR \tx@UserCoor /Ry ED /Rx ED
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf Ox Oy Rx Ry ConicEllipseInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \pnode(! Ex Ey){#7}
+ \pnode(! Fx Fy){#8}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \Pst@ManageParamList{#8}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicHyperbolaInter[Options](O)(m,n){a,b,c,d,e,f}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and the given hyperbola $(x-O_x)^2/m^2-(y-O_y)^2/n^2=1$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the center O of the given hyperbola
+%% #3 -> [input] the radius (m,n) of the given hyperbola
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+%% #7 -> [output] the third intersection node name
+%% #8 -> [output] the fourth intersection node name
+\def\pstGeneralConicHyperbolaInter{\@ifnextchar[\Pst@GeneralConicHyperbolaInter{\Pst@GeneralConicHyperbolaInter[]}}
+\def\Pst@GeneralConicHyperbolaInter[#1](#2)(#3)#4#5#6#7#8{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempO%
+ \pst@getcoor{#3}\pst@tempR%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Hyperbola
+ \pst@tempO \tx@UserCoor /Oy ED /Ox ED
+ \pst@tempR \tx@UserCoor /Ry ED /Rx ED
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf Ox Oy Rx Ry ConicHyperbolaInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \pnode(! Ex Ey){#7}
+ \pnode(! Fx Fy){#8}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \Pst@ManageParamList{#8}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicIHyperbolaInter[Options](O)(m,n){a,b,c,d,e,f}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and the given conjugate hyperbola $(y-O_y)^2/m^2-(x-O_x)^2/n^2=1$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the center O of the given conjugate hyperbola
+%% #3 -> [input] the radius (m,n) of the given conjugate hyperbola
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+%% #7 -> [output] the third intersection node name
+%% #8 -> [output] the fourth intersection node name
+\def\pstGeneralConicIHyperbolaInter{\@ifnextchar[\Pst@GeneralConicIHyperbolaInter{\Pst@GeneralConicIHyperbolaInter[]}}
+\def\Pst@GeneralConicIHyperbolaInter[#1](#2)(#3)#4#5#6#7#8{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempO%
+ \pst@getcoor{#3}\pst@tempR%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Hyperbola
+ \pst@tempO \tx@UserCoor /Oy ED /Ox ED
+ \pst@tempR \tx@UserCoor /Ry ED /Rx ED
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf Ox Oy Rx Ry ConicIHyperbolaInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \pnode(! Ex Ey){#7}
+ \pnode(! Fx Fy){#8}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \Pst@ManageParamList{#8}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicParabolaInter[Options](O){p}{a,b,c,d,e,f}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and the given parabola $(x-x0)^2=2p(y-y0)$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the vertex O of the given parabola
+%% #3 -> [input] the half of focal chord $p$
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+%% #7 -> [output] the third intersection node name
+%% #8 -> [output] the fourth intersection node name
+\def\pstGeneralConicParabolaInter{\@ifnextchar[\Pst@GeneralConicParabolaInter{\Pst@GeneralConicParabolaInter[]}}
+\def\Pst@GeneralConicParabolaInter[#1](#2)#3#4#5#6#7#8{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempO%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Parabola
+ \pst@tempO \tx@UserCoor /Oy ED /Ox ED
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf Ox Oy #3 ConicParabolaInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \pnode(! Ex Ey){#7}
+ \pnode(! Fx Fy){#8}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \Pst@ManageParamList{#8}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicIParabolaInter[Options](O){p}{a,b,c,d,e,f}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and the given conjugate parabola $(y-y0)^2=2p(x-x0)$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the vertex O of the given conjugate parabola
+%% #3 -> [input] the half of focal chord $p$
+%% #4 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #5 -> [output] the first intersection node name
+%% #6 -> [output] the second intersection node name
+%% #7 -> [output] the third intersection node name
+%% #8 -> [output] the fourth intersection node name
+\def\pstGeneralConicIParabolaInter{\@ifnextchar[\Pst@GeneralConicIParabolaInter{\Pst@GeneralConicIParabolaInter[]}}
+\def\Pst@GeneralConicIParabolaInter[#1](#2)#3#4#5#6#7#8{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempO%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#4}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Parabola
+ \pst@tempO \tx@UserCoor /Oy ED /Ox ED
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf Ox Oy #3 ConicIParabolaInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#5}
+ \pnode(! Dx Dy){#6}
+ \pnode(! Ex Ey){#7}
+ \pnode(! Fx Fy){#8}
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \Pst@ManageParamList{#8}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicInter[Options]{a,b,c,d,e,f}{a',b',c',d',e',f'}{C}{D}{E}{F}
+%% Get the most four intersections $C$, $D$, $E$ and $F$ of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$ and $a'x^2+b'xy+c'y^2+d'x+e'y+f'=0$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #3 -> [input] the coefficents of the quadratic curve equation, with six numbers $a',b',c',d',e',f'$ joined with comma.
+%% #4 -> [output] the first intersection node name
+%% #5 -> [output] the second intersection node name
+%% #6 -> [output] the third intersection node name
+%% #7 -> [output] the fourth intersection node name
+\def\pstGeneralConicInter{\@ifnextchar[\Pst@GeneralConicInter{\Pst@GeneralConicInter[]}}
+\def\Pst@GeneralConicInter[#1]#2#3#4#5#6#7{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#2}
+ \pstParseArg{CurveCoef}{A,B,C,D,E,F}{#3}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ % Conic a'x^2+b'xy+c'y^2+d'x+e'y+f'=0
+ \CurveCoefA /CA ED
+ \CurveCoefB /CB ED
+ \CurveCoefC /CC ED
+ \CurveCoefD /CD ED
+ \CurveCoefE /CE ED
+ \CurveCoefF /CF ED
+ tx@EcldDict begin Ca Cb Cc Cd Ce Cf CA CB CC CD CE CF ConicInter end
+ /nInters ED /Inters ED
+ nInters 0 gt {
+ /XYPair Inters 0 get def
+ XYPair 0 get XYPair 1 get
+ } {
+ 0 0
+ } ifelse
+ /Dx 0 def /Dy 0 def
+ /Ex 0 def /Ey 0 def
+ /Fx 0 def /Fy 0 def
+ nInters 1 gt {
+ /XYPair Inters 1 get def
+ /Dx XYPair 0 get def
+ /Dy XYPair 1 get def
+ } if
+ nInters 2 gt {
+ /XYPair Inters 2 get def
+ /Ex XYPair 0 get def
+ /Ey XYPair 1 get def
+ } if
+ nInters 3 gt {
+ /XYPair Inters 3 get def
+ /Fx XYPair 0 get def
+ /Fy XYPair 1 get def
+ } if
+ ){#4}
+ \pnode(! Dx Dy){#5}
+ \pnode(! Ex Ey){#6}
+ \pnode(! Fx Fy){#7}
+ \Pst@ManageParamList{#4}%
+ \Pst@ManageParamList{#5}%
+ \Pst@ManageParamList{#6}%
+ \Pst@ManageParamList{#7}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicTangentLine[Options]{A}{a,b,c,d,e,f}{B}
+%% Get the tangent line through point $A% on the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the point $A$ on the conic.
+%% #3 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #4 -> [output] the node name $B$ on the tangent line.
+\def\pstGeneralConicTangentLine{\@ifnextchar[\Pst@GeneralConicTangentLine{\Pst@GeneralConicTangentLine[]}}
+\def\Pst@GeneralConicTangentLine[#1]#2#3#4{%
+ \begingroup
+ \@InitListMng %
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempA%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#3}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ \pst@tempA \tx@UserCoor /Ay ED /Ax ED
+ Ca Ax mul Ax mul
+ Cb Ax mul Ay mul add
+ Cc Ay mul Ay mul add
+ Cd Ax mul add
+ Ce Ay mul add
+ Cf add abs 1E-5 lt {
+ % axx_A+b(x_Ay+xy_A)/2+cy_Ay+d(x_A+x)/2+e(y_A+y)/2+f=0
+ /LA Ca Ax mul Cb Ay mul 2 div add Cd 2 div add def
+ /LB Cc Ay mul Cb Ax mul 2 div add Ce 2 div add def
+ /LC Cd Ax mul 2 div Ce Ay mul 2 div add Cf add def
+ LB abs 1E-5 lt {
+ Ax Ay 1 add
+ } {
+ Ax 1 add
+ LA Ax 1 add mul LC add LB div neg
+ } ifelse
+ } {
+ 0 0
+ } ifelse
+ ){#4}
+ \Pst@ManageParamList{#4}%
+ \endgroup%
+}%
+%
+%% \pstGeneralConicTangentChord[Options]{T}{a,b,c,d,e,f}{A}{B}
+%% Get the tangent line through point $T% out of the General Conic $ax^2+bxy+cy^2+dx+ey+f=0$,
+%% and output the tangent nodes A and B.
+%
+%% Parameters:
+%% #1 -> options
+%% #2 -> [input] the point $A$ on the conic.
+%% #3 -> [input] the coefficents of the quadratic curve equation, with six numbers $a,b,c,d,e,f$ joined with comma.
+%% #4 -> [output] the node name $A$ on the tangent chord.
+%% #5 -> [output] the node name $B$ on the tangent chord.
+\def\pstGeneralConicTangentChord{\@ifnextchar[\Pst@GeneralConicTangentChord{\Pst@GeneralConicTangentChord[]}}
+\def\Pst@GeneralConicTangentChord[#1]#2#3#4#5{%
+ \begingroup
+ \psset{#1}%
+ \pst@getcoor{#2}\pst@tempT%
+ \pstParseArg{CurveCoef}{a,b,c,d,e,f}{#3}
+ \pnode(!
+ % Conic ax^2+bxy+cy^2+dx+ey+f=0
+ \CurveCoefa /Ca ED
+ \CurveCoefb /Cb ED
+ \CurveCoefc /Cc ED
+ \CurveCoefd /Cd ED
+ \CurveCoefe /Ce ED
+ \CurveCoeff /Cf ED
+ \pst@tempT \tx@UserCoor /Ty ED /Tx ED
+ Ca Tx mul Tx mul
+ Cb Tx mul Ty mul add
+ Cc Ty mul Ty mul add
+ Cd Tx mul add
+ Ce Ty mul add
+ Cf add abs 1E-5 gt {
+ % axx_T+b(x_Ty+xy_T)/2+cy_Ty+d(x_T+x)/2+e(y_T+y)/2+f=0
+ /LA Ca Tx mul Cb Ty mul 2 div add Cd 2 div add def
+ /LB Cc Ty mul Cb Tx mul 2 div add Ce 2 div add def
+ /LC Cd Tx mul 2 div Ce Ty mul 2 div add Cf add def
+ LB abs 1E-5 lt {
+ LC LA div neg Ty 1 add
+ LC LA div neg Ty 1 sub /By ED /Bx ED
+ } {
+ Tx 1 add LA Tx 1 add mul LC add LB div neg
+ Tx 1 sub LA Tx 1 sub mul LC add LB div neg /By ED /Bx ED
+ } ifelse
+ } {
+ 0 0 0 0 /By ED /Bx ED
+ } ifelse
+ ){Pst@GeneralConicTCA}
+ \pnode(! Bx By){Pst@GeneralConicTCB}
+ \pstGeneralConicLineInter{Pst@GeneralConicTCA}{Pst@GeneralConicTCB}{#3}{#4}{#5}
+ \endgroup%
+}%
+%
\catcode`\@=\PstAtCode\relax
%
\endinput