## maxima-commits

 [Maxima-commits] CVS: maxima/doc/info Trigonometric.texi, 1.22, 1.23 From: Dieter Kaiser - 2009-10-29 18:29:34 ```Update of /cvsroot/maxima/maxima/doc/info In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13464/doc/info Modified Files: Trigonometric.texi Log Message: Updating the documentation of halfangles. Index: Trigonometric.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/Trigonometric.texi,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Trigonometric.texi 1 Mar 2009 19:42:29 -0000 1.22 +++ Trigonometric.texi 29 Oct 2009 18:29:00 -0000 1.23 @@ -360,12 +360,40 @@ @closecatbox @end deffn +@c ----------------------------------------------------------------------------- @defvr {Option variable} halfangles Default value: @code{false} -When @code{halfangles} is @code{true}, -trigonometric functions of arguments @code{@var{expr}/2} -are simplified to functions of @var{expr}. +When @code{halfangles} is @code{true}, trigonometric functions of arguments +@code{@var{expr}/2} are simplified to functions of @var{expr}. + +For a real argument @var{x} in the interval @code{0 < x < 2*%pi} the sine of +the half-angle simplifies to a simple formula: + +@example + sqrt(1 - cos(x)) + ---------------- + sqrt(2) +@end example + +A complicated factor is needed to make this formula correct for all complex +arguments @var{z}: + +@example + realpart(z) + floor(-----------) + 2 %pi +(- 1) (1 - unit_step(- imagpart(z)) + + realpart(z) realpart(z) + floor(-----------) - ceiling(-----------) + 2 %pi 2 %pi + ((- 1) + 1)) +@end example + +Maxima knows this factor and similar factors for the functions @code{sin}, +@code{cos}, @code{sinh}, and @code{cosh}. For special values of the argument +@math{z} these factors simplify accordingly. Examples: @@ -374,28 +402,35 @@ @c sin (x / 2); @c halfangles : true\$ @c sin (x / 2); +@c assume(x>0, x<2*%pi)\$ +@c sin(x / 2); @c ===end=== @example -(%i1) halfangles : false\$ -@... -(%i2) sin (x / 2); - x -(%o2) sin(-) - 2 -@... group -(%i3) halfangles : true\$ -@... -(%i4) sin (x / 2); - sqrt(1 - cos(x)) -(%o4) ---------------- - sqrt(2) -@... group +(%i1) halfangles:false; +(%o1) false +(%i2) sin(x/2); + x +(%o2) sin(-) + 2 +(%i3) halfangles:true; +(%o3) true +(%i4) sin(x/2); + x + floor(-----) + 2 %pi + sqrt(1 - cos(x)) (- 1) +(%o4) ---------------------------------- + sqrt(2) +(%i5) assume(x>0, x<2*%pi)\$ +(%i6) sin(x/2); + sqrt(1 - cos(x)) +(%o6) ---------------- + sqrt(2) @end example @opencatbox @category{Trigonometric functions} @category{Simplification flags and variables} @closecatbox - @end defvr @c IS THIS DESCRIPTION ACCURATE ?? ```