texlive[43006] Master: trigonometry (21jan17)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 21 23:40:40 CET 2017


Revision: 43006
          http://tug.org/svn/texlive?view=revision&revision=43006
Author:   karl
Date:     2017-01-21 23:40:40 +0100 (Sat, 21 Jan 2017)
Log Message:
-----------
trigonometry (21jan17)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-genericextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/generic/trigonometry/
    trunk/Master/texmf-dist/doc/generic/trigonometry/README.txt
    trunk/Master/texmf-dist/tex/generic/trigonometry/
    trunk/Master/texmf-dist/tex/generic/trigonometry/trigonometry.tex
    trunk/Master/tlpkg/tlpsrc/trigonometry.tlpsrc

Added: trunk/Master/texmf-dist/doc/generic/trigonometry/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/generic/trigonometry/README.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/generic/trigonometry/README.txt	2017-01-21 22:40:40 UTC (rev 43006)
@@ -0,0 +1,3 @@
+The file "Trigonometry.tex" is released under the Knuthian Licence, the current CTAN entry for which reads along the following lines (amendments to grammar and spelling made in the following text) --
+
+"This soft­ware is copy­right and you are ex­plic­itly granted a li­cence which allows  you, the “user” of the soft­ware, to copy, dis­tribute and/or mod­ify the soft­ware, provided only that if you mod­ify and then re-distribute the soft­ware it must be with a dif­fer­ent name to that of the orig­i­nal soft­ware."
\ No newline at end of file

Added: trunk/Master/texmf-dist/tex/generic/trigonometry/trigonometry.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/trigonometry/trigonometry.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/trigonometry/trigonometry.tex	2017-01-21 22:40:40 UTC (rev 43006)
@@ -0,0 +1,206 @@
+%= = = = = = = = = = = = = T R I G O N O M E T R Y . T E X = = = = = = = = =
+ 
+%%% Trigonometry.TeX: (as published in TeXhax Digest, September 1989)
+%%% Philip Taylor, Royal Holloway and Bedford New College, University of London
+ 
+%%% Routines to calculate the sine of an angle expressed in radians.
+%%% So far as I can tell, the results are accurate to four places
+%%% of decimals, for arguments in the range -pi/2 .. pi/2, except
+%%% for `ridiculously small' arguments, which cannot be accurately represented.
+ 
+%%% The routines for cosine and tangent are left to the reader ...
+ 
+%%% After a call to \Sin (<angle>), the result is available for typesetting
+%%% or boxing, and may also be extracted from the control-sequence \sine.
+ 
+%%% Grouping is used to hide most things, but the following csnames are
+%%% globally defined:
+ 
+%%% \nodimen, \n at dimen, \product, \sine, \term, \t at rm, \Term
+ 
+\newif \ifdebug %%% turn me on to see TeX hard at work ...
+ 
+\def \term #1{{x^{#1} \over #1!}}
+The power series expansion for $\sin$ is:
+$$ \sin x = x - \term3 + \term5 - \term7 + \cdots$$
+\indent and for $\cos$ is:
+$$ \cos x = 1 - \term2 + \term4 - \term6 + \cdots$$
+ 
+\let \then = \relax
+\chardef \letter = 11
+\chardef \other = 12
+\def \radian {pt }
+\let \radians = \radian
+\let \dimensionlessunit = \radian
+\let \dimensionlessunits = \dimensionlessunit
+\def \internalunit {sp }
+\let \internalunits = \internalunit
+\newif \ifstillconverging
+\def \Message #1{\ifdebug \then \message {#1} \fi}
+ 
+{ %%% Things that need abnormal catcodes %%%
+	\catcode `\@ = \letter
+	\gdef \nodimen {\expandafter \n at dimen \the \dimen}
+	\gdef \term #1 #2 #3%
+	       {\edef \t@ {\the #1}%%% freeze parameter 1 (count, by value)
+		\edef \t@@ {\expandafter \n at dimen \the #2\radian}%
+				   %%% freeze parameter 2 (dimen, by value)
+		\t at rm {\t@} {\t@@} {#3}%
+	       }
+	\gdef \t at rm #1 #2 #3%
+	       {{%
+		\count 0 = 0
+		\dimen 0 = 1 \dimensionlessunit
+		\dimen 2 = #2\relax
+		\Message {Calculating term #1 of \nodimen 2}%
+		\loop
+		\ifnum	\count 0 < #1
+		\then	\advance \count 0 by 1
+			\Message {Iteration \the \count 0 \space}%
+			\Multiply \dimen 0 by {\dimen 2}%
+			\Message {After multiplication, term = \nodimen 0}%
+			\Divide \dimen 0 by {\count 0}%
+			\Message {After division, term = \nodimen 0}%
+		\repeat
+		\Message {Final value for term #1 of
+				\nodimen 2 \space is \nodimen 0}%
+		\xdef \Term {#3 = \nodimen 0 \radians}%
+		\aftergroup \Term
+	       }}
+	\catcode `\p = \other
+	\catcode `\t = \other
+	\gdef \n at dimen #1pt{#1} %%% throw away the ``pt''
+}
+ 
+\def \Divide #1by #2{\divide #1 by #2} %%% just a synonym
+ 
+\def \Multiply #1by #2%%% allows division of a dimen by a dimen
+       {{%%% should really freeze parameter 2 (dimen, passed by value)
+	\count 0 = #1\relax
+	\count 2 = #2\relax
+	\count 4 = 65536
+	\Message {Before scaling, count 0 = \the \count 0 \space and
+			count 2 = \the \count 2}%
+	\ifnum	\count 0 > 32767 %%% do our best to avoid overflow
+	\then	\divide \count 0 by 4
+		\divide \count 4 by 4
+	\else	\ifnum	\count 0 < -32767
+		\then	\divide \count 0 by 4
+			\divide \count 4 by 4
+		\else
+		\fi
+	\fi
+	\ifnum	\count 2 > 32767 %%% while retaining reasonable accuracy
+	\then	\divide \count 2 by 4
+		\divide \count 4 by 4
+	\else	\ifnum	\count 2 < -32767
+		\then	\divide \count 2 by 4
+			\divide \count 4 by 4
+		\else
+		\fi
+	\fi
+	\multiply \count 0 by \count 2
+	\divide \count 0 by \count 4
+	\xdef \product {#1 = \the \count 0 \internalunits}%
+	\aftergroup \product
+       }}
+ 
+\def \Sin (#1)%
+       {{%
+	\dimen 0 = #1 \radian
+	\dimen 2 = 3.1415926535897963 \radian %%% a well-known constant
+	\divide	\dimen 2 by 2 %%% we only deal with -pi/2 : pi/2
+	\ifdim	\dimen 0 > \dimen 2
+	\then	\message {Sin: argument (\nodimen 0) too large
+						--- use range reduction}%
+		\xdef \sine {<undefined>}%
+	\else	\ifdim	\dimen 0 < - \dimen 2
+		\then	\message {Sin: argument (\nodimen 0) too large
+						--- use range reduction}%
+			\xdef \sine {<undefined>}%
+		\else	\Message {Sin: calculating Sin of \nodimen 0}%
+			\count 0 = 1 %%% see power-series expansion for sine
+			\dimen 2 = 1 \radian %%% ditto
+			\dimen 4 = 0 \radian %%% ditto
+			\loop
+				\ifnum	\dimen 2 = 0 %%% then we've done
+				\then	\stillconvergingfalse
+				\else	\stillconvergingtrue
+				\fi
+				\ifstillconverging %%% then calculate next term
+				\then	\term {\count 0} {\dimen 0} {\dimen 2}%
+					\advance \count 0 by 2
+					\count 2 = \count 0
+					\divide \count 2 by 2
+					\ifodd	\count 2 %%% signs alternate
+					\then	\advance \dimen 4 by \dimen 2
+					\else	\advance \dimen 4 by -\dimen 2
+					\fi
+			\repeat
+			\xdef \sine {\nodimen 4}%
+		\fi
+	\fi
+	\aftergroup \sine
+       }}
+ 
+%%% What follows is just a demonstration of the \Sin function
+ 
+$$
+\def \rule {\noalign {\hrule}}
+\def \SIN (#1){&#1&&\Sin (#1)&\cr\noalign{\message {The sine of #1 is \sine}}}
+\mathcode `\- = 32768 %%% just a bodge to improve alignment
+\let \minus = -
+\begingroup
+\catcode `\- = \active
+\gdef -{\llap{\minus}}
+\endgroup
+\vbox {\offinterlineskip
+\halign
+{\vrule #& \qquad \hfil $#$ & \vrule # & \qquad $#$ \hfil & \vrule # \strut \cr
+	\rule
+	&\omit {\hfil $x$ \hfil} && \omit {\hfil $\sin x$ \hfil} & \cr
+	\rule
+	\SIN (-1.6)
+	\SIN (-1.5)
+	\SIN (-1.4)
+	\SIN (-1.3)
+	\SIN (-1.2)
+	\SIN (-1.1)
+	\SIN (-1.0)
+	\SIN (-0.9)
+	\SIN (-0.8)
+	\SIN (-0.7)
+	\SIN (-0.6)
+	\SIN (-0.5)
+	\SIN (-0.4)
+	\SIN (-0.3)
+	\SIN (-0.2)
+	\SIN (-0.1)
+	\SIN (-0.01)
+	\SIN (-0.001)
+	\SIN (-0.0001)
+	\SIN (0)
+	\SIN (0.0001)
+	\SIN (0.001)
+	\SIN (0.01)
+	\SIN (0.1)
+	\SIN (0.2)
+	\SIN (0.3)
+	\SIN (0.4)
+	\SIN (0.5)
+	\SIN (0.6)
+	\SIN (0.7)
+	\SIN (0.8)
+	\SIN (0.9)
+	\SIN (1.0)
+	\SIN (1.1)
+	\SIN (1.2)
+	\SIN (1.3)
+	\SIN (1.4)
+	\SIN (1.5)
+	\SIN (1.6)
+	\rule}
+}
+$$
+\end
+ 

Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-01-21 22:38:41 UTC (rev 43005)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-01-21 22:40:40 UTC (rev 43006)
@@ -608,7 +608,8 @@
     translation-filecontents-de translation-moreverb-de
     translation-natbib-fr translation-tabbing-fr
     translations
-    tree-dvips treetex trfsigns trimspaces trivfloat trsym truncate
+    tree-dvips treetex trfsigns
+    trigonometry trimspaces trivfloat trsym truncate
     tsemlines
     tucv tudscr tufte-latex tugboat tugboat-plain
     tui turabian turabian-formatting turkmen turnstile turnthepage

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2017-01-21 22:38:41 UTC (rev 43005)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2017-01-21 22:40:40 UTC (rev 43006)
@@ -1812,6 +1812,7 @@
  'translation-europecv-de',     'NULL', # doc
  'translation-tabbing-fr',      'NULL', # doc
  'treetex',     '(treetex|l_pic|classes)\.tex',
+ 'trigonometry','\.tex',
  'truncate',    '^..[^s].*\.sty',       # not miscdoc.sty
  'tudscr',	'DDC.*|TUD.*|' . $standardtex,
  'tugboat-plain','\.cmn|' . $standardtex,

Modified: trunk/Master/tlpkg/tlpsrc/collection-genericextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-genericextra.tlpsrc	2017-01-21 22:38:41 UTC (rev 43005)
+++ trunk/Master/tlpkg/tlpsrc/collection-genericextra.tlpsrc	2017-01-21 22:40:40 UTC (rev 43006)
@@ -51,6 +51,7 @@
 depend tabto-generic
 depend termmenu
 depend tracklang
+depend trigonometry
 depend texapi
 depend upca
 depend xlop

Added: trunk/Master/tlpkg/tlpsrc/trigonometry.tlpsrc
===================================================================


More information about the tex-live-commits mailing list