summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/generic/pst-math/Changes5
-rw-r--r--Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdfbin147850 -> 155766 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex62
-rw-r--r--Master/texmf-dist/dvips/pst-math/pst-math.pro40
-rw-r--r--Master/texmf-dist/tex/generic/pst-math/pst-math.tex2
5 files changed, 97 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-math/Changes b/Master/texmf-dist/doc/generic/pst-math/Changes
index 00fa71e866c..0f3c21108b8 100644
--- a/Master/texmf-dist/doc/generic/pst-math/Changes
+++ b/Master/texmf-dist/doc/generic/pst-math/Changes
@@ -1,4 +1,9 @@
..... pst-math.pro
+0.3 2007-11-01 added SEC, COSEC and COTAN functions (cj)
+ added a range check on ACOS, ASIN, ACOSH and ATANH
+ added ArgumentOutOfRange to issue a warning message
+ in the postscript document if needed
+ fixed a small bug in SINC
0.2 2007-08-30 added GAMMA function (hv)
0.1 first CTAN version (cj)
diff --git a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf
index b9f4114e28e..9b1fb2bc7da 100644
--- a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex
index e2d92f518a0..671c45e405d 100644
--- a/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex
+++ b/Master/texmf-dist/doc/generic/pst-math/pst-math-doc.tex
@@ -105,7 +105,8 @@ x&\mapsto&{\operator@font#1}(x)\end{array}\right.}
\begin{document}
-\title{\MathPackage\\ A PSTricks package for enhancing mathematical operators in PSTricks\\ \normalsize ver. 0.2}
+\title{\MathPackage\\ A PSTricks package for enhancing mathematical operators in PSTricks\\
+\normalsize ver. 0.3}
\author{Christophe \textsc{Jorssen} \texttt{<christophe.jorssen@libre.fr.invalid>}\\ \footnotesize `libre' is the french word for `free'}
\date{\today}
\maketitle
@@ -154,6 +155,48 @@ Div PSTricks operator rather than with div PS operator.} when $x=k\frac{pi}{2}$.
\end{pspicture}
\end{SideBySideExample}
+\MathPackage{} introduces natural trigonometric postscript operators SEC, COSEC and COTAN
+defined by
+\[\DefOfOperator{sec}{%
+ \mathbb R\backslash\{k\frac{\pi}{2},k\in\mathbb{Z}\}}{]-\infty,-1]\bigcup [1,+\infty[}\]
+\[\DefOfOperator{cosec}%
+ {\mathbb R\backslash\{k\pi,k\in\mathbb Z\}}{]-\infty,-1]\bigcup [1,+\infty[}\]
+\[\DefOfOperator{cotan}%
+ {\mathbb R\backslash\{k\pi,k\in\mathbb Z\}}{\mathbb R}\]
+where $x$ is in \emph{radians}.
+\begin{center}
+\begin{tabular}{c|c|c|c}
+ \textbf{Stack} & \textbf{Operator} & \textbf{Result} & \textbf{Description} \\
+ \hline
+ \textsf{\textsl{num}} & \textsf{\textbf{SEC}} & \textsf{\textsl{real}} & Return secant of
+ \textsf{\textsl{num}} radians \\
+ \hline
+ \textsf{\textsl{num}} & \textsf{\textbf{COSEC}} & \textsf{\textsl{real}} & Return cosecant of
+ \textsf{\textsl{num}} radians \\
+ \hline
+ \textsf{\textsl{num}} & \textsf{\textbf{COTAN}} & \textsf{\textsl{real}} & Return cotangent
+of \textsf{\textsl{num}} radians
+\end{tabular}
+\end{center}
+
+\begin{SideBySideExample}[xrightmargin=10.5cm]
+ \begin{pspicture}*(-5,-2)(5,2)
+ \SpecialCoor % For label positionning
+ \psaxes[labels=y,Dx=/HLCBWz&\pstPI2"]{->}%
+ (0,0)(-5,-2)(5,2)
+ \uput[-90](!/HLCBWz&PI" 0){$\pi$}
+ \uput[-90](!/HLCBWz&PI" neg 0){$-\pi$}
+ \uput[-90](!/HLCBWz&PI" 2 div 0)%
+ {$\frac{\pi}{2}$}
+ \uput[-90](!/HLCBWz&PI" 2 div neg 0)%
+ {$-\frac{\pi}{2}$}
+ \psplot[linecolor=blue]{-5}{5}{x /HLCBWz&SEC"}
+ \psplot[linecolor=red]{-5}{5}{x /HLCBWz&COSEC"}
+ \psplot[linecolor=green]{-5}{5}{x /HLCBWz&COTAN"}
+ \end{pspicture}
+\end{SideBySideExample}
+
+
\MathPackage{} introduces natural trigonometric postscript operators ACOS, ASIN and ATAN defined by
\[\DefOfOperator{acos}{[-1,1]}{[0,\pi]}\]
\[\DefOfOperator{asin}{[-1,1]}{[-\frac{\pi}2,\frac{\pi}2]}\]
@@ -382,9 +425,24 @@ ATANH defined by
\end{pspicture}
\end{SideBySideExample}
+\section{Warnings}
+
+Since version 0.3, there is a new feature. When an argument of \textsf{\textbf{ACOS}},
+\textsf{\textbf{ASIN}}, \textsf{\textbf{ACOSH}} or \textsf{\textbf{ATANH}} is out of range,
+the result of the calculation does not product a PS error: a zero value is substitued and a
+warning message is printed on the postscript version of the document.
+
+\begin{SideBySideExample}[xrightmargin=10.5cm]
+ \begin{pspicture}(-1,-4)(5,4)
+ \psaxes{->}(0,0)(-1,-4)(5,4)
+ \psplot[linecolor=blue]{/HLCBWz&0"}{5}%
+ {x ACOSH}
+ \end{pspicture}
+\end{SideBySideExample}
+
\section{Credits}
-Many thanks to Jacques L'helgoualc'h and Herbert Voss.
+Many thanks to Jacques L'helgoualc'h, Herbert Voss and Martin Chicoine.
\end{document}
diff --git a/Master/texmf-dist/dvips/pst-math/pst-math.pro b/Master/texmf-dist/dvips/pst-math/pst-math.pro
index 6b3e790aecb..333877ad284 100644
--- a/Master/texmf-dist/dvips/pst-math/pst-math.pro
+++ b/Master/texmf-dist/dvips/pst-math/pst-math.pro
@@ -5,9 +5,15 @@
% Author : Christophe JORSSEN <christophe.jorssen@libre.fr.invalid>
% ('libre' is the french word for 'free' if you want to contact me ;-))
% Created the : Sat 20 March 2004
-% Last Mod : $Date: 2004/05/08 13:40:15 $
-% Version : 1.1 $
+% Last Mod : Thu 01 November 2007
+% Version : 1.3
%
+/ArgumentOutOfRange {%
+ gsave /Times-Roman findfont 10 scalefont setfont 0 0 moveto
+ ([pst-math] At least one argument was out of range) show grestore} bind def
+
+/DIV { dup 0 eq { pop ArgumentOutOfRange} { div } ifelse } bind def
+
/PI 3.14159265359 def
/ENeperian 2.71828182846 def
@@ -19,21 +25,37 @@
/TAN {dup SIN exch COS Div} bind def
/tan {dup sin exch cos Div} bind def
/ATAN {neg -1 atan 180 sub DegToRad} bind def
-/ACOS {dup dup mul neg 1 add sqrt exch atan DegToRad} bind def
-/acos {dup dup mul neg 1 add sqrt exch atan} bind def
-/ASIN {neg dup dup mul neg 1 add sqrt neg atan 180 sub DegToRad} bind def
-/asin {neg dup dup mul neg 1 add sqrt neg atan 180 sub} bind def
+
+/sec {cos 1 exch Div} bind def
+/cosec {sin 1 exch Div} bind def
+/cotan {dup cos exch sin Div} bind def
+/SEC {RadToDeg sec} bind def
+/COSEC {RadToDeg cosec} bind def
+/COTAN {RadToDeg cotan} bind def
+
+/acos {dup dup -1 ge exch 1 le and
+ {dup dup mul neg 1 add sqrt exch atan}
+ {pop 0 ArgumentOutOfRange} ifelse} bind def
+/ACOS {acos DegToRad} bind def
+/asin {dup dup -1 ge exch 1 le and
+ {neg dup dup mul neg 1 add sqrt neg atan 180 sub}
+ {pop 0 ArgumentOutOfRange} ifelse} bind def
+/ASIN {asin DegToRad} bind def
/EXP {ENeperian exch exp} bind def
/COSH {dup EXP exch neg EXP add 2 div} bind def
/SINH {dup EXP exch neg EXP sub 2 div} bind def
/TANH {dup SINH exch COSH div} bind def
-/ACOSH {dup dup mul 1 sub sqrt add ln} bind def
+/ACOSH {dup 1 ge
+ {dup dup mul 1 sub sqrt add ln}
+ {pop 0 ArgumentOutOfRange} ifelse} bind def
/ASINH {dup dup mul 1 add sqrt add ln} bind def
-/ATANH {dup 1 add exch neg 1 add Div ln 2 div} bind def
+/ATANH {dup dup -1 gt exch 1 lt and
+ {dup 1 add exch neg 1 add Div ln 2 div}
+ {pop 0 ArgumentOutOfRange} ifelse} bind def
-/SINC {dup SIN exch Div} bind def
+/SINC {dup 0 eq {pop 1} {dup SIN exch Div} ifelse} bind def
/GAUSS {dup mul 2 mul dup 4 -2 roll sub dup mul exch div neg EXP exch PI mul sqrt div} bind def
diff --git a/Master/texmf-dist/tex/generic/pst-math/pst-math.tex b/Master/texmf-dist/tex/generic/pst-math/pst-math.tex
index 33a35367213..7e3202a632e 100644
--- a/Master/texmf-dist/tex/generic/pst-math/pst-math.tex
+++ b/Master/texmf-dist/tex/generic/pst-math/pst-math.tex
@@ -19,7 +19,7 @@
\def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}}
\RCS$Revision: 1.0 $ \RCS$Date: 2004-06-15 22:29:36+02 $
-\def\fileversion{0.2}
+\def\fileversion{0.3}
\message{`pst-math' v\fileversion\space (Rev \RCSRevision, \RCSDate), C.Jorssen}