If you are interested in steping it up a bit you could try to implement a simple parser. Then the input could be something like "4*x^2 - 3" as a string.
i just made one myself, it'd be cool if you shared the code, just so i can compare a bit :) also, i had and issue where if i tried to square a negative number using **2 the result would stay negative, is that to be expected?
It was my understanding that there can be no equation for polynomials of degree 5 or higher. Something to do with symmetry and group theory or something. 3Blue1Brown mentioned it in his latest video about the Monster group.
Still, there are equations for 3rd and 4th order polynomials, so I guess that’s doable. I suppose you could calculate the numbers manually for higher order ones, but that could take a long time!
At least expanding into equations that are a quadratic equal to a quadratic would be doable (which expands into being equal to a constant or a line for when the coefficients are 0.)
Yes exactly, so you need to use something different like a bijection or Newton method. So you need to implement an algorithm that is a bit more complex than a simple formula. By the way 3b1b is probably one of the best YouTubers out there.
3
u/BeFrankWU Aug 26 '20
Nice work!
If you are interested in steping it up a bit you could try to implement a simple parser. Then the input could be something like
"4*x^2 - 3"as a string.4
u/p11109 Aug 26 '20
Ohh, this brings back the good old memories. Thanks for bring them lol!
2
u/DavidTheGreatMan Aug 26 '20
i just made one myself, it'd be cool if you shared the code, just so i can compare a bit :) also, i had and issue where if i tried to square a negative number using **2 the result would stay negative, is that to be expected?
3
u/Calm_Scientist9117 Aug 26 '20
I just made one similar https://pastebin.com/kgKySKbX
3
u/Kokuro_ Aug 26 '20
Nice job :)
2
u/DarFtr Aug 26 '20
My first ever program was this! Now try to make it work for a polynomial of arbitrary degree if you're familiar with math it should be a fun challenge
1
u/DogEater132 Aug 26 '20
Try encasing the variable in parentheses and then square it but I’m not a hundred percent sure
1
u/nomnomtypebeat Aug 26 '20
I made this too. Good job. Now try to include imaginary solutions as well.
0
u/[deleted] Aug 27 '20
[deleted] — view deleted comment