%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                      %
% GLE - Graphics Layout Engine <http://www.gle-graphics.org/>          %
%                                                                      %
% Modified BSD License                                                 %
%                                                                      %
% Copyright (C) 2009 GLE.                                              %
%                                                                      %
% Redistribution and use in source and binary forms, with or without   %
% modification, are permitted provided that the following conditions   %
% are met:                                                             %
%                                                                      %
%    1. Redistributions of source code must retain the above copyright %
% notice, this list of conditions and the following disclaimer.        %
%                                                                      %
%    2. Redistributions in binary form must reproduce the above        %
% copyright notice, this list of conditions and the following          %
% disclaimer in the documentation and/or other materials provided with %
% the distribution.                                                    %
%                                                                      %
%    3. The name of the author may not be used to endorse or promote   %
% products derived from this software without specific prior written   %
% permission.                                                          %
%                                                                      %
% THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR   %
% IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED       %
% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE   %
% ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY       %
% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL   %
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE    %
% GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS        %
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER %
% IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR      %
% OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN  %
% IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                        %
%                                                                      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\appendix
\chapter{Tables}
\section{Markers}
\index{markers}
\mbox{\input{primitives/fig/gc_marker.inc}}

\section{Functions and Variables}
\index{functions}
\label{fct:sec}

GLE has the following built in functions and variables in the following catagories

\subsection{General Program}

\begin{supertabular}{ll} \hline
Function name     & Returns  \\ \hline
{\tt arg(i)} \index{arg()}       	    & i-th command line argument \\
{\tt arg\$(i)} \index{arg()}            & i-th command line argument \\
{\tt dataxvalue(ds,i)} \index{dataxvalue} & $x$-value of $i$-th point in ds (p.~\pageref{dataxvalue})\\
{\tt datayvalue(ds,i)} \index{datayvalue} & $y$-value of $i$-th point in ds (p.~\pageref{datayvalue})\\
{\tt date\$()} \index{date\$()}      	& current date e.g. ``Tue Apr 09 1991'' \\
{\tt device\$()} \index{device\$()}  	& available devices e.g. ``HARDCOPY, PS''\\
{\tt getenv(str)} \index{getenv{}}      & returns environment variable ``str''\\
{\tt eval(str)} \index{eval()}         	& evaluates given GLE expression \\
{\tt $\backslash{}$expr(exp)} \index{$\backslash{}$expr(exp)} & substitute result of evaluating ``exp'' \\
{\tt file\$()} \index{file\$()}         & returns GLE file name (without extension) \\
{\tt height(name\$)} \index{height()} 	& the height of the object {\tt name\$} \\
{\tt nargs()} \index{nargs()}       	& number of command line arguments \\
{\tt ndata(ds)} \index{ndata}           & number of points in data set ds (p.~\pageref{ndata})\\
{\tt ndatasets()} \index{ndatasets}     & number of available data sets\\
{\tt not(exp)} \index{not()}         	& logical not of {\tt exp} \\
{\tt pageheight()} \index{pageheight()} & the height of the page (from size command) \\
{\tt pagewidth()} \index{pagewidth()}	& the width of the page (from size command) \\
{\tt path\$()} \index{path\$()}         & returns the directory where the script is located \\
{\tt pointx(pt)} \index{pointx()}    	& the x value of named point pt \\
{\tt pointy(pt)} \index{pointy()}    	& the y value of named point pt \\
{\tt ptx(pt)} \index{ptx()}          	& the x value of named point pt (abbreviation for pointx) \\
{\tt pty(pt)} \index{pty()}         	& the y value of named point pt (abbreviation for pointy)\\
{\tt rgb(red,green,blue)} \index{rgb()}  & create color given RGB values \\
{\tt rgba(red,green,blue,alpha)} \index{rgba()}  & create color given RGB and alpha values \\
{\tt rgb255(red,green,blue)} \index{rgb255()}  & create color given RGB values \\
{\tt rgba255(red,green,blue,alpha)} \index{rgba255()}  & create color given RGB and alpha values \\
{\tt tdepth(str\$)} \index{tdepth()} 	& the depth of {\tt str\$} assuming current the font, size \\
{\tt theight(str\$)} \index{theight()}  & the height of {\tt str\$} assuming  current font, size \\
{\tt twidth(str\$)} \index{twidth()} 	& the width of {\tt str\$} assuming current font, size \\
{\tt time\$()} \index{time\$()}      	& current time e.g. ``11:44:27'' \\
{\tt width(name\$)} \index{width()} 	& the width of the object {\tt name\$} \\
\end{supertabular}


\subsection{String or Text Manipulation}

\begin{supertabular}{ll} \hline
Function Name     & Returns  \\ \hline
{\tt num\$(exp)} \index{num\$()}     	& string representation of {\tt exp} \\
{\tt num1\$(exp)} \index{num1\$()}   	& as above but with no spaces \\
{\tt pos(str1\$,str2\$,exp)} \index{pos()}     & position of {\tt str2\$} in {\tt str1\$} from {\tt exp} \\
{\tt right\$(str\$,exp)} \index{right\$()}     & rest of {\tt str\$} starting at {\tt exp} \\
{\tt seg\$(str\$,exp1,exp2)} \index{seg\$()}   & {\tt str\$} from {\tt exp1} to {\tt exp2} \\
{\tt val(str\$)} \index{val()}       	& value of the string {\tt str\$} \\
{\tt left\$(str\$,exp)} \index{left\$()}  & left {\tt exp} characters of {\tt str\$} \\
{\tt len(str\$)} \index{len()}       	& the length of {\tt str\$} \\
{\tt format\$(exp,format)} \index{format\$()} & format {\tt exp} as specified in {\tt format} (p.~\pageref{formatnum:pg})\\
\end{supertabular}

\subsection{Mathematical Functions \& Constants}

GLE provides the following mathematical functions and constants.  All angles are in radians. The constant values have 16 digits of precision within GLE.  The constants and special functions are from the boost C++ libraries or the C++ standard math libraries.

\begin{supertabular}{ll} \hline
Constants & Value  \\ \hline
{\tt pi} \index{pi}      & $\pi = 3.14159265358979323846 $ \\
{\tt two\_pi} \index{two\_pi}  & $2\pi $ \\
{\tt root\_pi} \index{root\_pi} & $\sqrt{\pi}$ \\
{\tt half\_pi} \index{half\_pi}  & $\pi/2$ \\
{\tt root\_two} \index{root\_two}  & $\sqrt{2}$ \\
{\tt root\_three} \index{root\_three}  & $\sqrt{3}$ \\
{\tt \_e\_} \index{\_e\_}     & $e^1$ \\
\end{supertabular}



\begin{supertabular}{ll} \hline
Function & Returns  \\ \hline
{\tt abs($x$)} \index{abs()}         	& absolute value of $x$ \\
{\tt acos($x$)} \index{acos()}       	& inverse cosine of $x$ \\
{\tt acosh($x$)} \index{acosh()}     	& inverse hyperbolic cosine of $x$ \\
{\tt acot($x$)} \index{acot()}       	& 1/atan($x$) \\
{\tt acoth($x$)} \index{acoth()}     	& 1/atanh($x$) \\
{\tt acsc($x$)} \index{acsc()}	     	& 1/asin($x$) \\
{\tt acsch($x$)} \index{acsch()}     	& 1/asinh($x$) \\
{\tt asec($x$)} \index{asec()}       	& 1/acos($x$) \\
{\tt asech($x$)} \index{asech()}     	& 1/acosh($x$) \\
{\tt asin($x$)} \index{asin()}       	& inverse sine of $x$ \\
{\tt asinh($x$)} \index{asinh()}     	& inverse hyperbolic sine of $x$\\
{\tt atan($x$)} \index{atan()}       	& inverse tangent of $x$ \\
{\tt atanh($x$)} \index{atanh()}     	& inverse hyperbolic tangent of $x$ \\
{\tt atn($x$)} \index{atn()}         	& same as atan($x$) ({\it deprecated, kept for backward compatibility} ) \\
{\tt cos($x$)} \index{cos()}         	& cosine of $x$ \\
{\tt cosh($x$)} \index{cosh()}       	& hyperbolic cosine of $x$ \\
{\tt cot($x$)} \index{cot()}         	& 1/tan($x$) \\
{\tt coth($x$)} \index{coth()}       	& 1/tanh($x$) \\
{\tt csc($x$)} \index{csc()}            & 1/sin($x$) \\
{\tt csch($x$)} \index{csch()}       	& 1/sinh($x$) \\
{\tt erf($x$)} \index{eval()}         	& Gaussian error function of $x$ \\
{\tt exp($x$)} \index{exp()}         	& $e^x$  \\
{\tt fix($x$)} \index{fix()}         	& $x$ rounded towards 0 \\
{\tt int($x$)} \index{int()}         	& integer part of $x$ \\
{\tt log($x$)} \index{log()}         	& log to base $e$ of $x$ \\
{\tt log10($x$)} \index{log10()}     	& log to base 10 of $x$ \\
{\tt rnd($x$)} \index{rnd()}         	& random number between 0 and $x$ \\
{\tt sdiv(x,y)} \index{sdvi()}	     	& return x/y or 0 if y = 0 \\
{\tt sec($x$)} \index{sec()}	     	& 1/cos($x$) \\
{\tt sech($x$)} \index{sech()}       	& 1/cosh($x$) \\
{\tt sgn($x$)} \index{sgn()}         	& returns 1 if $x$ is positive, -1 if $x$ is negative \\
{\tt sin($x$)} \index{sin()}         	& sine of $x$ \\
{\tt sinh($x$)} \index{sinh()}       	& hyperbolic sine of $x$ \\
{\tt sqr($x$)} \index{sqr()}         	& $x$ squared  \\
{\tt sqrt($x$)} \index{sqrt()}       	& square root of $x$ \\
{\tt tan($x$)} \index{tan()}         	& tangent of $x$ \\	
{\tt tanh($x$)} \index{tanh()}       	& hyperbolic tangent of $x$ \\
{\tt todeg($x$)} \index{todeg()}     	& convert from radians to degrees \\
{\tt torad($x$)} \index{torad()}     	& convert from degrees to radians \\
{\tt associated\_laguerre($n$,$x$)} \index{associated\_laguerre()}   & $n^{th}$ order associated Laguerre polynomial of $x$   \\
{\tt spherical\_harmonic($n$,$m$,$\theta$,$\phi$)} \index{spherical\_harmonic()}       & real valued spherical harmonic, $\theta$ polar angle $[0,\pi]$, $\phi$ azimuthal angle $[0,2\pi]$. \\
{\tt factorial($n$)} \index{factorial()}     	           & $n!$ \\
{\tt double\_factorial($n$)} \index{double\_factorial()}      & $n!!$  \\
{\tt hermite($n$,x)} \index{hermite()}     	               & $n^{th}$ order Hermite polynomial of $x$ \\
{\tt associated\_legendre($\ell$,$x$)} \index{associated\_legendre()}     & $\ell^{th}$-order associated Legendre polynomial of $x$ \\
{\tt bessel\_first($v$,$x$)} \index{bessel\_first()}     	   & Bessel function of the first kind \\
{\tt bessel\_second($v$,$x$)} \index{bessel\_second()}        & Bessel function of the second kind \\
{\tt airy\_first($x$)} \index{airy\_first()}     	           & Airy function of the first kind \\
{\tt airy\_second($x$)} \index{airy\_second()}     	       & Airy function of the second kind \\
{\tt chebyshev\_first($n$,$x$)} \index{chebyshev\_first()}      & $n^{th}$ order Chebyshev polynomial of the first kind of $x$  \\
{\tt chebyshev\_second($n$,$x$)} \index{chebyshev\_second()}    & $n^{th}$ order Chebyshev polynomial of the second kind of $x$  \\
\end{supertabular}


\subsection{Graphing}

Graph variables and function that provide information from preceding graph block

\begin{supertabular}{ll} \hline
Function Name     & Returns  \\ \hline
{\tt xgmin} \index{xgmin} & the minimum x-coordinate of the graph \\
{\tt xgmax} \index{xgmax} & the maximum x-coordinate of the graph \\
{\tt xg2min} \index{xg2min} & the minimum x2-coordinate of the graph \\
{\tt xg2max} \index{xg2max} & the maximum x2-coordinate of the graph \\
{\tt ygmin} \index{ygmin} & the minimum y-coordinate of the graph \\
{\tt ygmax} \index{ygmax} & the maximum y-coordinate of the graph \\
{\tt yg2min} \index{yg2min} & the minimum y2-coordinate of the graph \\
{\tt yg2max} \index{yg2max} & the maximum y2-coordinate of the graph \\
{\tt xbar(x,i)} \index{xbar()}        	& the absolute x coordinate of the i-th bar at point x on the graph \\
{\tt xend()} \index{xend()}          	& the x end point of a text string when drawn \\
{\tt xg(xexp)} \index{xg()}             & converts units of last graph to abs cm. \\
{\tt xg3d(x,y,z)} \index{xg3d()}        & converts units of last 3D graph to abs cm. \\
{\tt xpos()} \index{xpos()}          	& the current x point \\
{\tt xy2angle(dx,dy)} \index{xy2angle()}& convert rectangular coordinates to polar angle (in degrees)\\
{\tt yend()} \index{yend()}          	& the y end point of a text string when drawn \\
{\tt yg(yexp)} \index{yg()}             & converts units of last graph to abs cm. \\
{\tt yg3d(x,y,z)} \index{yg3d()}        & converts units of last 3D graph to abs cm. \\
{\tt ypos()} \index{ypos()}          	& the current y point \\
\end{supertabular}

\input{appendix/sym}
\newpage

%\section{Installing GLE}
%\label{install:app}

\section{Fonts}

\index{fonts} \index{font-examples}
\resizebox{!}{22cm}{\includegraphics{appendix/fig/ap_fonts}}
\newpage

%%
% \clearpage
% \input{appendix/sm_single}
%%
% \clearpage
% \input{appendix/sm_stack2}
%
% \clearpage
% \input{appendix/sm_stack4b}
%%
% \clearpage
% \input{appendix/sm_stack1}
%%
% \clearpage
% \input{appendix/sm_loop}
%%
% \clearpage
% \input{appendix/sm_join}
%%
% \clearpage
% \input{appendix/sm_clip}
%%
%%\cleardoublepage

