Commit 67 added variable support into gCAS2. The PC build has x and y defined as pi and -9.8, respectively. You cannot define variables yet, this will be added shortly.
Also, I was thinking about function support in gCAS2. I will need to make the cas use operation flags to determine how and when things should be evaluated. For example, right now, if you do (x+1)*(x+2)*(x+3), gCAS2 will expand everything in that function, making loads of nodes. This isn't OK for stuff like (x+1)^100, clearly. A flag will be used to only expand/foil/distribute (or otherwise add more nodes) at certain times. Other flags would be used for things like approx, degrees (radians default), factoring, and making variable-sized nodes.
Side-question, anyone know any cas theory for 2-sided expressions? It would be awesome for gCAS2 to solve stuff like solve(y=e^(2*x),x). I am looking myself, but don't know much on where to start looking other than aimlessly googling...
Edit: I am thinking about making certain numbers constant, like e, π, and infinity. Instead of making them decimal numbers right away, it will keep it in forms like e^π. Trying to figure out how to get it to work. I could treat it like a variable... trig functions would handle them nicely and such, but I don't know how it would work elsewhere.
Edit: So, I am trying to think about how to order things in the CAS's evaluate function. I have this order:
- Evaluate simple algorithms that do basic algebra.
- Distribute multiplication/division (if flagged)
- Group similar nodes into a vs node (cas_node_vs, variable sized).
- Approximate constants and fractions (if flagged)
also trying to get cas_node_vs put into the code, as well as flags... This will be ugly
Edit: gCAS2 is now breaking all compat. except for variables (somehow). Get ready to rewrite gCAS2 interaction code when these upgrades are done.