Skip to main content

solveQuadratic

solveQuadratic(a, b, c, result, result_offset) ⇒ number

Return solutions for a quadratic polynomial: ax² + bx + c Typically there will be 2 solution, in some cases we will have 0, having 1 solution is impossible This solver only deals with real numbers, so imaginary solution are not provided. In case solution would be imaginary - we return 0 roots

Kind: global function
Returns: number - number of found solutions (roots)

ParamTypeDescription
anumber
bnumber
cnumber
resultArray.<number>solutions are written here
result_offsetnumberoffset into result array where solutions are written to