From: Chris S. <san...@us...> - 2005-06-20 15:43:35
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/scripts/maxima Modified Files: stackmaxima.mac Log Message: Major changes to the font end. Attempt 1. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** stackmaxima.mac 12 Jun 2005 16:10:01 -0000 1.13 --- stackmaxima.mac 20 Jun 2005 15:42:54 -0000 1.14 *************** *** 455,459 **** /* (1) p is degree 0 in v */ /* (2.1) p is linear in v, and the coefficients have no common factors */ ! /* (2.2) p is linear in v, and the coefficients of v is 1 */ /* (3) p is quadratic, the coefficients have no common factors */ /* and p does not factor over the **rationals** */ --- 455,459 ---- /* (1) p is degree 0 in v */ /* (2.1) p is linear in v, and the coefficients have no common factors */ ! /* (2.2) p is linear in v, and the coefficients of v is -1 */ /* (3) p is quadratic, the coefficients have no common factors */ /* and p does not factor over the **rationals** */ *************** *** 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 ]"); |