I decided I should write my own graphing class instead of using one of the far superior existing ones, mostly as a learning experience. It's not great and doesn't look very pretty, but it has some cool features and I'm still working on it.
Here it is graphing your run of the mill quadratic, and on the right finding the roots using Newton's method:
As you can see there are plenty of problems. It doesn't handle non-contiguous functions well and it doesn't look very pretty. Asymptotic functions also look a little off.
That's enough about how bad it is, it also manages to do some pretty cool stuff. For one it can handle derivatives fairly well. Here's a cubic and it's derivative.
Fairly standard stuff. It uses a five point stencil to differentiate. Basically it picks a grid of points very close to the point it's differentiating and essentially uses the limit definition of the derivative to compute it.
It can also numerically solve ordinary diffential equations. Below you can see in red the numerical solution in black and the actual solution in red.
It's pretty good at approximating the solution. I chose a fairly large step size in the graph above to show a quick and rough approximation. My ODE solver uses the Runge-Kutta method to numerically solve the Diff Eqs. Unfortunately it's rather inefficient. Anything beyond a homogenous first order differential equation takes embarrasingly long to solve. I'm currently trying other methods to make it more efficient. Also coming soon will be a PDE solver.