From: Chris S. <san...@us...> - 2005-06-18 09:54:26
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/scripts/maxima Modified Files: Tag: frontend_dev stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** stackmaxima.mac 14 Jun 2005 11:36:07 -0000 1.13.2.1 --- stackmaxima.mac 18 Jun 2005 09:54:12 -0000 1.13.2.2 *************** *** 557,577 **** )$ - /* A function for one particular type of question! */ - - /* fntrans_unpack(ex) */ - /* ex is assumed to be an expression of the form, a*f(b*x+c)+d */ - /* That is to say, the result of applying some kind of grpahical transformation to f. */ - /* If the function sucesfully unpacks this, it returns the list [TRUE,a,b,c,d] */ - /* If the function fails, it returns [FALSE,a,b,c,d], where it goes as far as it can. */ - fntrans_unpack(ex):=BLOCK([f,l,a,b,c,d], - l:ex, - if atom(l) then RETURN([FALSE,a,b,c,d]), - if op(l)="+" then (d:part(l,2),l:part(l,1)) else d:0, - if atom(l) then RETURN([FALSE,a,b,c,d]), - if op(l)="*" then (a:part(l,1),l:part(l,2)) else a:1, - if op(l)=f then (l:part(l,1),b:coeff(l,x,1),c:coeff(l,x,0)) else RETURN([FALSE,a,b,c,d]), - /* if atom(l) then RETURN([FALSE,a,b,c,d]), */ - RETURN([TRUE,a,b,c,d]) - )$ /* An answer test based expandp(sa). */ --- 557,560 ---- *************** *** 645,648 **** --- 628,655 ---- )$ + /*******************************************************************************/ + /* Very specific maxima functions */ + /*******************************************************************************/ + + + /* A function for one particular type of question! */ + + /* fntrans_unpack(ex) */ + /* ex is assumed to be an expression of the form, a*f(b*x+c)+d */ + /* That is to say, the result of applying some kind of grpahical transformation to f. */ + /* If the function sucesfully unpacks this, it returns the list [TRUE,a,b,c,d] */ + /* If the function fails, it returns [FALSE,a,b,c,d], where it goes as far as it can. */ + fntrans_unpack(ex):=BLOCK([f,l,aa,bb,cc,dd], + l:ex, + if atom(l) then RETURN([FALSE,aa,bb,cc,dd]), + if op(l)="+" then (dd:part(l,2),l:part(l,1)) else dd:0, + if atom(l) then RETURN([FALSE,aa,bb,cc,dd]), + if op(l)="*" then (aa:part(l,1),l:part(l,2)) else aa:1, + if op(l)=f then (l:part(l,1),bb:coeff(l,x,1),cc:coeff(l,x,0)) else RETURN([FALSE,aa,bb,cc,dd]), + /* if atom(l) then RETURN([FALSE,aa,bb,cc,dd]), */ + RETURN([TRUE,aa,bb,cc,dd]) + )$ + + /* Stack expects some output */ print("[ Stack-Maxima started ]"); |