January 29, 2014

Polar Graphs - part 3

Made some progress!

Some improvements: I now display the graph and equations in separate windows, so that it's not terribly confusing to have multiple graphs on the same square.  Now I just need to add the equations I wanna display to one vector<string> and it'll draw those graphs and also display the equations in the window.

Yup, I went ahead and did the recursive descent parser.  It could still use improvements - I have to end it with an arbitrary character so the program won't try and parse invalid data (right now I'm using an exclamation point).  It's not good at error handling and it assumes the data is fed to it perfectly.  It won't even handle white space yet, and I can only use whole numbers because it doesn't know how to deal with decimal points yet.  So I'll need to work on that but it's a start.

Also, all of this is in one file and I don't like that.  The recursive descent parser should at least be in a separate file, it not more functions.  With C# or Java it's really easy to separate out things into different files, not quite fluent with C++ so simple things like this are really difficult.

Of course this program could use a lot of improvement but a lot of the extra functionality I wanted to include are in here now.

Click here to see my code:


Picture:



Not too fond of how it displays the exclamation points still in the display but I'll fix that