Quadratische Gleichung
Quadratische Gleichung
API Declarations
ZweiEchteWurzeln ' 2 real
EineEchteWurzel ' 1 real, 1 imaginaer
ZweiImaginaereWurzeln ' 2 imaginaer
'EineEchteZweiImaginaereWurzeln
'DreiEchteWurzeln
End Enum
Rate Quadratische Gleichung
(1(1 Vote))
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
Quadratische Gleichung Comments
No comments yet — be the first to post one!
Post a Comment