By the way, if it's been more than 24 hours and no one has responded, you are allowed to bump a topic by double-posting; it's not against etiquette.
I only have it locally on my computer and as part of a private Mercurial repository, but I can package up my current version and send it along to you. Would you PM me an email address at which I can reach you?
The additions and modifications I have are:
(1) Making gCAS2 work with PrizmSDK
(2) Implementing some of the trig functions (sin, cos, tan, atan)
AHelper would be a better guide to using gCAS2 than me, but I will show you a sample bit of code taken and modified from pieces of Graph3DP:
Code: // Initialize equation and variables, get parse tree of equation
char* thiseq = "3*sin(X+2Z)";
memset(vars,0,sizeof(cas_var)*MAX_NUM_VARS); //XXXX ? 2012-06-18 suggest removal
tree = gcas_parse(&thiseq,0,0,(cas_node*)CASERR_FIRST_PARSE,0,vars,MAX_NUM_VARS);
free(saveeq);
// Check if equation was successfully parsed or was poorly-formed
if (parse_is_error(tree)) {
equations[i].valid = 0;
printf("Invalid equation...");
exit(-1);
}
// Set "X" and "Y" variables to val_x and val_y
if (0 > (id = gcas_get_var_id(vars, "X", MAX_NUM_VARS))) return -1;
if (0 > gcas_setvariable_float(vars,id,"X",val_x)) return -1;
if (0 > (id = gcas_get_var_id(vars, "Y", MAX_NUM_VARS))) return -1;
if (0 > gcas_setvariable_float(vars,id,"Y",val_y)) return -1;
// Evaluate the tree (plug in X and Y and simplify)
gcas_tree_eval(&tree, vars, MAX_NUM_VARS, lApprox | lBasic);
if (tree->type == nNUMBER) { //if the output was a number...
printf("%f\t%f\t%f\n",val_x,val_y,tree->number.nN); //print it
}