For school I need do a project about maths and I thought I could use my C++ coding to help but I really have no idea what project I could do. I can do anything to do with maths but I need ideas on what to program, i've just finished A level further maths so can anyone think of a project I can do to involve all of that?
Hey, a while ago i made a simple calculator which could do all 4 standard calculations. it is very easily extended, only requiring the functions to be made in a separate file and defined in a header. i made this at a beginner level (but a bit higher). considering you know some c++, and you've done A level maths (whatever that is), it wouldn't be so hard.
I was thinking of doing a calculator but the problem is there wouldn't be much mathematical thinking involved, i would just be using functions already in math.h. I am guessing that you are not from England, A levels are qualifications before college/university here and I really was looking for a way to mix something from what we've done to programming.
well im still in secondary school (year 8) and i was thinking that your maths might be able to help you develop a calculator for doing equations or calculations from your level of maths where you could feed the program all the parts of your sum and it could solve it or simplify it. (note: you don't need to use functions that are in math.h, make your own!! i did).
I once did a project when learning C. It would take an algebraic expression as entered one character at a time and build the expression into a binary tree that maintained the correct order of precedence.
Then I wrote a routine to produce a graphical representation of the binary tree in 2D that would scale the sub-expressions according to mathematical conventions. So the '2' of x^2 would be raised and made smaller like this: x2. And a '/' would be a horizontal bar separating the numerator expression from the denominator, wide enough to cover the largest of the two. I used a mathematical font for the integral symbol and the square root symbol etc.
I also wrote an output routine to generate an SVG (similar) graphical file.
I had then planned to build functions to re-arrange the equation algebraically and hopefully create methods to solve basic equations. Simultaneous equations etc... But I didn't get that far and sadly I lost all the source code for that many years ago.
But I found it very interesting, and a great project for learning C.
build the expression into a binary tree that maintained the correct order of precedence
That's called an "abstract syntax tree". Technically speaking, it's an n-ary tree; it's just that all your operands were binary.
Parsing an expression is always fun, but it's even more interesting to also evaluate it. Once you can do that, you can do something like approximating for any function the tangent line, or the area under the curve or the length of the curve in a range. Those two last ones are particularly interesting because they provide a lot of room for accuracy improvement and optimizations.