How to calculate sin(%pi/12);

  • Albrecht Mueller

    I guess you want to tell wxmaxima to do numerical instead of symbolic calculations. There is a menu entry that toggles the numerical flag. Another way to control this behaviour is to set the flag using the assignment statements "numer:true" or "numer:false".

    Last edit: Albrecht Mueller 2014-03-10
  • Aleksas

    Aleksas - 2014-03-18

    (%i1) x=sin(%pi/12);
    (%o1) x=sin(%pi/12)
    (%i2) asin(%);
    (%o2) asin(x)=%pi/12
    (%i3) %12;
    (%o3) 12
    (%i4) sin(%);
    (%o4) sin(12asin(x))=0
    (%i5) trigexpand(%);
    (%o5) 12
    (%i6) spr:solve(%,x);
    (%o6) [x=-sqrt(3)/2,x=sqrt(3)/2,x=-sqrt(sqrt(3)+2)/2,x=sqrt(sqrt(3)+2)/2,x=-sqrt(2-sqrt(3))/2,x=sqrt(2-sqrt(3))/2,x=-1/2,x=1/2,x=-1/sqrt(2),x=1/sqrt(2),x=-1,x=1,x=0]
    (%i7) ats:sublist(spr,lambda([e],is(abs(rhs(e)-sin(%pi/12))<10^(-10))));
    (%o7) [x=sqrt(2-sqrt(3))/2]
    (%i8) float(%), numer;
    (%o8) [x=0.25881904510252]

    With my package "trigtools":
    (%i9) load(trigtools);
    (%o9) "C:/Users/Aleksas/maxima/trigtools.mac"
    (%i10) trigeval(sin(%pi/12));
    (%o10) (sqrt(3)-1)/2^(3/2)
    (%i11) float(%), numer;
    (%o11) 0.25881904510252

    Other examples of trigeval:

    (%i4) sin(%pi/120);
    (%o4) sin(%pi/120)
    (%i5) trigeval(%),rootscontract,ratsimp;
    (%o5) sqrt(4-sqrt(2sqrt(sqrt(6sqrt(5)+30)+sqrt(5)+7)+8))/2^(3/2)
    (%i6) float(%), numer;
    (%o6) 0.026176948307872
    (%i11) float(sin(%pi/120));
    (%o11) 0.026176948307873
    (%i12) sin(%pi/128);
    (%o12) sin(%pi/128)
    (%i13) trigeval(%);
    (%o13) sqrt(2-sqrt(sqrt(sqrt(sqrt(sqrt(2)+2)+2)+2)+2))/2
    (%i14) cos(%pi/128);
    (%o14) cos(%pi/128)
    (%i15) trigeval(%);
    (%o15) sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(2)+2)+2)+2)+2)+2)/2


    Aleksas D


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks