symbolic math - Maxima: trigonometric numbers in radical form -
beginner's question maxima: how can obtain trigonometric numbers in radical form?
for example, expression evaluates nicely:
(%i) cos( 3 * %pi / 4); 1 (%o) - ------- sqrt(2) but 1 not:
(%i) cos(3 * %pi / 5); 3 %pi (%o) cos(-----) 5 i expect show this:
(%i) cos( 3 * %pi / 5); 1 - sqrt(5) (%o) ----------- 4 see, example, output wolfram alpha:
from maxima documentation piargs, true default:
when
%piargstrue, trigonometric functions simplified algebraic constants when argument integer multiple of %pi, %pi/2, %pi/3, %pi/4, or %pi/6.
from maxima documentation ntrig:
the
ntrigpackage contains set of simplification rules used simplify trigonometric function arguments of formf(n%pi/10)f of functionssin,cos,tan,csc,sec,cot.
this work 3π/5, not more complex values π/96:
(%i) load(ntrig); (%o) /usr/share/maxima/5.34.1/share/trigonometry/ntrig.mac (%i) cos(3*%pi/5); 1 - sqrt(5) (%o) ----------- 4 (%i) sin(4*%pi/10); sqrt(sqrt(5) + 5) (%o) ----------------- 3/2 2 (%i) sin(%pi/96); %pi (%o) sin(---) 96 to evaluate more complex results, trigeval function trigtools package work:
(%i) load(trigtools); (%o) /usr/share/maxima/5.34.1/share/contrib/trigtools/trigtools.mac (%i) trigeval(sin(4*%pi/10)); sqrt(sqrt(5) + 5) (%o) ----------------- 3/2 2 (%i) trigeval(sin(%pi/96)); 9/8 3/2 5/4 sqrt(2 - sqrt(sqrt(sqrt(3) + 2 + 1) + 2 )) (%o) -------------------------------------------------- 17/16 2 there documentation trigtools, because part of 3rd-party contrib packages, not maintained. source code trigtools hasn't been updated since 2013.
also, trigeval seems work angles corresponding regular polygons, , not trigonometric numbers in general. example, cos (π / 23) = -(1/2)(-1)22/23(1+(-1)2/23), trigeval unhelpful in case:
(%i) trigeval(cos(%pi/23)); %pi (%o) cos(---) 23 credit goes serge de marre , raymond toy on maxima-discuss mailing list, david billinghurst on maxima area 51 stackexchange.
relevant links other mailing lists:
Comments
Post a Comment