changeset 11415:e7ed20f87e82

Add @tex blocks to gammainc and legendre docstrings.
author Michael Godfrey <godfrey@isl.stanford.edu>
date Sun, 26 Dec 2010 21:28:20 -0800
parents 5e6ef42a2445
children 74e285bb61c9
files scripts/ChangeLog scripts/specfun/legendre.m src/ChangeLog src/DLD-FUNCTIONS/gammainc.cc
diffstat 4 files changed, 53 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sat Dec 25 07:47:50 2010 -0800
+++ b/scripts/ChangeLog	Sun Dec 26 21:28:20 2010 -0800
@@ -1,3 +1,7 @@
+2010-12-26  Michael Godfrey <godfrey@isl.stanford.edu>
+
+	* specfun/legendre.m: Add @tex blocks to docstring.
+
 2010-12-24  Rik  <octave@nomad.inbox5.com>
 
 	* testfun/test.m: Use 'Command' for deftype in docstring.
--- a/scripts/specfun/legendre.m	Sat Dec 25 07:47:50 2010 -0800
+++ b/scripts/specfun/legendre.m	Sun Dec 26 21:28:20 2010 -0800
@@ -33,6 +33,12 @@
 ##
 ## The Legendre Function of degree @var{n} and order @var{m}:
 ##
+## @tex
+## $$
+## P^m_n(x) = (-1)^m (1-x^2)^{m/2}{d^m\over {dx^m}}P_n (x)
+## $$
+## @end tex
+## @ifnottex
 ## @example
 ## @group
 ##  m        m       2  m/2   d^m
@@ -40,10 +46,17 @@
 ##  n                         dx^m   n
 ## @end group
 ## @end example
+## @end ifnottex
 ##
 ## @noindent
 ## with Legendre polynomial of degree @var{n}:
 ##
+## @tex
+## $$
+## P(x) = {1\over{2^n n!}}\biggl({d^n\over{dx^n}}(x^2 - 1)^n\biggr)
+## $$
+## @end tex
+## @ifnottex
 ## @example
 ## @group
 ##           1     d^n   2    n
@@ -51,6 +64,7 @@
 ##  n      2^n n!  dx^n
 ## @end group
 ## @end example
+## @end ifnottex
 ##
 ## @noindent
 ## @code{legendre (3, [-1.0, -0.9, -0.8])} returns the matrix:
@@ -73,6 +87,12 @@
 ##
 ## For Legendre functions of degree n and order 0:
 ##
+## @tex
+## $$
+## SP^0_n (x) = P^0_n (x)
+## $$
+## @end tex
+## @ifnottex
 ## @example
 ## @group
 ##   0       0
@@ -80,9 +100,16 @@
 ##   n       n
 ## @end group
 ## @end example
+## @end ifnottex
 ##
 ## For Legendre functions of degree n and order m:
 ##
+## @tex
+## $$
+## SP^m_n (x) = P^m_n (x)(-1)^m\biggl({2(n-m)!\over{(n+m)!}}\biggl)^{0.5}
+## $$
+## @end tex
+## @ifnottex
 ## @example
 ## @group
 ##   m       m          m    2(n-m)! 0.5
@@ -90,6 +117,7 @@
 ##   n       n               (n+m)!
 ## @end group
 ## @end example
+## @end ifnottex
 ##
 ## If the optional argument @var{normalization} is @code{"norm"}, 
 ## compute the fully normalized associated Legendre function.
@@ -98,6 +126,12 @@
 ##
 ## For Legendre functions of degree @var{n} and order @var{m}
 ##
+## @tex
+## $$
+## NP^m_n (x) = P^m_n (x)(-1)^m\biggl({(n+0.5)(n-m)!\over{(n+m)!}}\biggl)^{0.5}
+## $$
+## @end tex
+## @ifnottex
 ## @example
 ## @group
 ##   m       m          m    (n+0.5)(n-m)! 0.5
@@ -105,6 +139,7 @@
 ##   n       n                   (n+m)!    
 ## @end group
 ## @end example
+## @end ifnottex
 ## @end deftypefn
 
 ## Author: Marco Caliari <marco.caliari@univr.it>
--- a/src/ChangeLog	Sat Dec 25 07:47:50 2010 -0800
+++ b/src/ChangeLog	Sun Dec 26 21:28:20 2010 -0800
@@ -1,3 +1,7 @@
+2010-12-26  Michael Godfrey <godfrey@isl.stanford.edu>
+
+	* gammainc.cc: Add @tex blocks to docstring.
+
 2010-12-25  Rik  <octave@nomad.inbox5.com>
 
 	* DLD-FUNCTIONS/str2double.cc: Fix bug in converting "numberi" strings
--- a/src/DLD-FUNCTIONS/gammainc.cc	Sat Dec 25 07:47:50 2010 -0800
+++ b/src/DLD-FUNCTIONS/gammainc.cc	Sun Dec 26 21:28:20 2010 -0800
@@ -41,20 +41,20 @@
 Compute the normalized incomplete gamma function,\n\
 @tex\n\
 $$\n\
- \\gamma (x, a) = {\\displaystyle\\int_0^x e^{-t} t^{a-1} dt \\over \\Gamma (a)}\n\
+ \\gamma (x, a) = {1 \\over {\\Gamma (a)}}\\displaystyle{\\int_0^x t^{a-1} e^{-t} dt}\n\
 $$\n\
 @end tex\n\
 @ifnottex\n\
 \n\
-@smallexample\n\
+@example\n\
 @group\n\
-                                x\n\
-                      1        /\n\
+                                 x\n\
+                       1        /\n\
 gammainc (x, a) = ---------    | exp (-t) t^(a-1) dt\n\
-                  gamma (a)    /\n\
-                            t=0\n\
+                   gamma (a)    /\n\
+                             t=0\n\
 @end group\n\
-@end smallexample\n\
+@end example\n\
 \n\
 @end ifnottex\n\
 with the limiting value of 1 as @var{x} approaches infinity.\n\
@@ -64,14 +64,14 @@
 for each element of @var{x} and vice versa.\n\
 \n\
 If neither @var{x} nor @var{a} is scalar, the sizes of @var{x} and\n\
-@var{a} must agree, and @var{gammainc} is applied element-by-element.\n\
+@var{a} must agree, and @code{gammainc} is applied element-by-element.\n\
 \n\
 By default the incomplete gamma function integrated from 0 to @var{x} is\n\
 computed.  If \"upper\" is given then the complementary function integrated\n\
-for @var{x} to infinity is calculated.  It should be noted that\n\
+from @var{x} to infinity is calculated.  It should be noted that\n\
 \n\
 @example\n\
-gammainc (@var{x}, @var{a}) = 1 - gammainc (@var{x}, @var{a}, \"upper\")\n\
+gammainc (@var{x}, @var{a}) @equiv{} 1 - gammainc (@var{x}, @var{a}, \"upper\")\n\
 @end example\n\
 @seealso{gamma, lgamma}\n\
 @end deftypefn")