ucsb-cs56-projects / cs56-utilities-grapher

-
0 stars 3 forks source link

Pull Request for Lab07 #23

Closed AlexanderJBauer closed 7 years ago

AlexanderJBauer commented 7 years ago

Issue #17 solved Issue #13 solved Drag functionality for the graph has been fixed Right click to zoom has been removed. At this point in time due to unexpected difficulties with the parser and csil crashing causing us to loose some work, the code is messy although it is complete and does run. To see the results of our work, run the application and make an Arbitrary Function. Although the Dialog Box that comes up warns to not put parentheses in weird places, you can basically do anything now. However that being said we have not fully handled errors, meaning functions that return an error because of faulty syntax or a similar problem, it doesn't graph even though it shows up as a function in the function panel. We will update with comments and neater tabulation in the near future.

qwertyuiop5040 commented 7 years ago

Update: We have set it up so our parser works as intended. The user can also use 'PI' or 'e' as constants. All the functions in the program now use the custom function. Dialog boxes give syntax error and will not accept invalid functions now. Any asymptotic points that evaluate to indeterminate are not graphed.

Possible concerns: We have chosen trig operations to have lower operator precedence than multiplication and division: 'cosx/2' is evaluated as 'cos(x)/2' 'cosx2' is evaluated as 'cos(x)*2'

The grapher seems to have a problem graphing Log functions. However, we find it extremely unlikely that any part of the parser is not evaluating Log and Ln correctly, as we treat Log and Ln the same in almost all places. We only differentiate them in perhaps 3-4 lines of code, as well as a token class for Log and Ln. We have found no evidence of these two functions not being evaluated correctly in the parser.

The variables x, y, t are all evaluated as THE SAME variable. We put them in for possible multivariable support for the future.

Code is messy in places and may not have best practices at some points.

Try these functions: cosx (3)cosx(4) sincossinx x^2ln(PI x(((((((x PI/ePI/ePI/e (x+(2+(1.432x1.32) //which becomes (x+(2+((1.432)(x)(1.32)))) xytxyt //becomes x^6, see Concerns above.