I have really not found any good sources where this solution/idea is presented. We started with JavaFX in my class and I have that homework.
I have a equation that should build a graph in JavaFX. I have the canvas ready. For example y = 4x^3 + 3x^2 - 3x + 1.
Here we can calculate some points:
x = -1, y = -4 + 3 + 3 + 1 = 3
x = 0, y = 1
x = 1, y = 5
x = 2, y = 4 * 2^3 + 3 * 2^2 - 3 * 2 + 1 = 39
As I can imagine, the idea is to stake step of about 0.1. But still I have no idea how to code that thing. Professor said, that our code has to solve any cubic equation. Bonus points if graph is centered around extremum points.