Mercurial > hg > octave-lyh
diff doc/interpreter/arith.txi @ 9155:ad20b967e1c9
Update section 17.3 (Trigonometry) of arith.txi
Add text to help strings to indicate which functions use radians and which use degrees.
Add cross-references to radian function descriptions.
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Sun, 26 Apr 2009 22:19:57 -0700 |
parents | 761fc0d3d980 |
children | 8c71a86c4bf4 |
line wrap: on
line diff
--- a/doc/interpreter/arith.txi +++ b/doc/interpreter/arith.txi @@ -103,7 +103,7 @@ @node Trigonometry @section Trigonometry -Octave provides the following trigonometric functions. Angles are +Octave provides the following trigonometric functions where angles are specified in radians. To convert from degrees to radians multiply by @iftex @tex @@ -113,7 +113,12 @@ @ifinfo @code{pi/180} @end ifinfo - (e.g., @code{sin (30 * pi/180)} returns the sine of 30 degrees). +(e.g., @code{sin (30 * pi/180)} returns the sine of 30 degrees). As +an alternative, Octave provides a number of trigonometric functions +which work directly on an argument specified in degrees. These functions +are named after the base trigonometric function with a @samp{d} suffix. For +example, @code{sin} expects an angle in radians while @code{sind} expects an +angle in degrees. @DOCSTRING(sin) @DOCSTRING(cos) @@ -143,22 +148,21 @@ @DOCSTRING(acsch) @DOCSTRING(acoth) -Each of these functions expects a single argument. For matrix arguments, -they work on an element by element basis. For example, +@DOCSTRING(atan2) +Octave provides the following trigonometric functions where angles are +specified in degrees. These functions produce true zeros at the appropriate +intervals rather than the small roundoff error that occurs when using +radians. For example: @example @group -sin ([1, 2; 3, 4]) - @result{} 0.84147 0.90930 - 0.14112 -0.75680 +cosd (90) + @result{} 0 +cos (pi/2) + @result{} 6.1230e-17 @end group @end example -@DOCSTRING(atan2) - -In addition to the trigonometric functions that work with radians, -Octave also provides the following functions which work with degrees. - @DOCSTRING(sind) @DOCSTRING(cosd) @DOCSTRING(tand) @@ -193,6 +197,8 @@ @DOCSTRING(ceil) +@DOCSTRING(cross) + @DOCSTRING(del2) @DOCSTRING(factor) @@ -236,9 +242,9 @@ @node Special Functions @section Special Functions -@DOCSTRING(besselj) +@DOCSTRING(airy) -@DOCSTRING(airy) +@DOCSTRING(besselj) @DOCSTRING(beta) @@ -248,6 +254,10 @@ @DOCSTRING(bincoeff) +@DOCSTRING(commutation_matrix) + +@DOCSTRING(duplication_matrix) + @DOCSTRING(erf) @DOCSTRING(erfc) @@ -263,12 +273,6 @@ @anchor{doc-gammaln} @DOCSTRING(lgamma) -@DOCSTRING(cross) - -@DOCSTRING(commutation_matrix) - -@DOCSTRING(duplication_matrix) - @node Coordinate Transformations @section Coordinate Transformations @@ -283,16 +287,16 @@ @node Mathematical Constants @section Mathematical Constants +@DOCSTRING(e) + +@DOCSTRING(pi) + @DOCSTRING(I) @DOCSTRING(Inf) @DOCSTRING(NaN) -@DOCSTRING(pi) - -@DOCSTRING(e) - @DOCSTRING(eps) @DOCSTRING(realmax)