|
'clase con capacidad matematica a traves de delegados
Public Class BVMathDelegate
Protected objCalc As ICalc
Public Sub New(ByVal CalcObject As ICalc)
objCalc = CalcObject
End Sub
'Derivada mediante Delegados
'28/10
Friend Function DerivadeDelegate(ByVal s1 As Single, ByVal ds As Single) As Single
Dim a1, a2 As Single
a1 = CType(objCalc, ICalcS).Calc(s1 - ds)
a2 = CType(objCalc, ICalcS).Calc(s1 + ds)
Return (0.5F * (a2 - a1) / (ds))
End Function
'28/10
Friend Function CalcDelegate(ByVal s As ComplexUndefinied) As ComplexUndefinied
Return CType(objCalc, ICalcU).Calc(s)
End Function
'28/10
Friend Function CalcDelegate(ByVal s As Single) As Single
Return CType(objCalc, ICalcS).Calc(s)
End Function
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.