Game Development Community

MSolveQuadratic gives wrong solutions

by Andrew Haydn Grant · in Torque Game Engine · 02/07/2006 (12:38 am) · 1 replies

In mSolveQuadratic_c (mSolver.cc, around line 63):
x[0] = ( b + sqrdesc) / den;
x[1] = ( b - sqrdesc) / den;

Those b's ought to be negated:
x[0] = (-b + sqrdesc) / den;
x[1] = (-b - sqrdesc) / den;


(-b +- sqrt( b^2 - 4ac)) / 2a

#1
02/07/2006 (3:57 pm)
Thanks! We were already tracking the issue but this brought it back up again and you fix got checked into TGE 1.4.1