by Ascher Stefan (8 Submissions)
Category: Math/Dates
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Mon 7th June 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Quadratische Gleichung
API Declarations
ZweiEchteWurzeln ' 2 real
EineEchteWurzel ' 1 real, 1 imaginaer
ZweiImaginaereWurzeln ' 2 imaginaer
'EineEchteZweiImaginaereWurzeln
'DreiEchteWurzeln
End Enum
alphaReal As Double, betaReal As Double, alphaImag As Double, _
betaImag As Double) As QKTypConst
Dim d As Double, X As Double, x1 As Double
d = (b ^ 2) - (4 * a * c)
If d > 0 Then
alphaReal = (-b + Sqr(d)) / (2 * a)
betaReal = (-b - Sqr(d)) / (2 * a)
QuadratischeGleichung = ZweiEchteWurzeln
ElseIf d = 0 Then
alphaReal = (-b) / (2 * a)
QuadratischeGleichung = EineEchteWurzel
Else
alphaReal = ((Sqr(-d) / (2 * a)))
alphaImag = ((-b) / (2 * a))
betaReal = -((Sqr(-d) / (2 * a)))
betaImag = ((-b) / (2 * a))
QuadratischeGleichung = ZweiImaginaereWurzeln
End If
End Function