Original Post
Im trying to make a program that takes inputs for a,b,c (ax^2+bx+c) and turns it into ex. (x-2)(x-5). i need to know some algorithm, but i dont. does someone know one.
Quote:
Original post by Anonymous Poster Quote:
Original post by joanusdmentia
Anyway, here's a hint. Rearrange both equations (ie. ax2+bx+c=0 and (x+m)(x+n)=0) until they are of similar form. With this you will be able to create 2 equations that equate some combination of m and n with some combination of a,b and c. Solve these equations simultaneously and you'll have your answer.
Could you, please, show how you plan to solve it like that?
If x^2 + px + q = (x-m)(x-n)
you get:
m + n = -p
mn = q
But solving this system is equivalent to solving a quadratic equation, so this does not help the original problem (i.e. it's the same). That is if I haven't missed something.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more