My new Quadratic Calcutor

* DO NOT DELETE THE “J” *
It represents the imaginary part of the solution, and is very important to keep in the program

4 Likes

I was never taught that in Algebra class.

1 Like

The imaginary part is actually represented as i, but Python has a reason (which I forget) for changing it to j

2 Likes

Oh, it’s i. Then use .replace('j', 'i') in the print statement.

3 Likes

Use .replace() to get rid of the parentheses too

3 Likes

Quadratic equations are in the form of ax^2 + bx + c = 0.

Another common form is a(x - k)^2 + h (turning point form). Quadratic equations do not necessarily have to be in ‘expanded’ form.

4 Likes

Not to argue but genuinely curious, what difference does it make?

1 Like

It indicates that you’ve taken an even root of a negative number ie the square root of -4 which could be said to be 2i. It cannot just be -2, since -2 * -2 = 4, not -4. Hence the reason to invent imaginary numbers; i represents the square root of -1, or a theoretical number that when multiplied by itself, equals -1. This enables us to perform many useful calculations; for example (and I have no idea how it works or anything, but) computer generated water is supposedly only possible using imaginary numbers.

2 Likes

I know about imaginary numbers. I was wondering why I needed to use replace instead of strip.

What does that mean?

2 Likes

Hmm… that is rather unclear lol, I don’t mean water literally created by a computer, that is impossible (at least right now… as far as I’m aware…), I mean computer generated graphics to simulate water, there’s all the physics, then the rendering and understanding how light interacts etc…

2 Likes

I understood quadratic equations on GeeksforGeeks, but I just used the understanding and I made the code.