Solves a quadratic equation. A quadratic equation is a second-order polynomial equation in a single variable, x.
ax2 + bx + c = 0
with a <> 0 . Because it is a second-order polynomial equation, the fundamental theorem of algebra guarantees that it has two solutions. These solutions may be both real, or both complex.
Rhino.SolveQuadratic (dblA, dblB, dblC)
dblA |
Required. Number. The A coefficient. |
dblB |
Required. Number. The B coefficient. |
dblC |
Required. Number. The C coefficient. |
Array |
The results of the calculation, if successful, where:
|
||||||||||||
Null |
If not successful, or on error. |
Dim arrSolve
arrSolve = Rhino.SolveQuadratic(2, 4, -30)
If IsArray(arrSolve) Then
Rhino.Print "Root 0 = " & CStr(arrSolve(1))
Rhino.Print "Root 1 = " & CStr(arrSolve(2))
End If