Concloo LotusScript Essentials Beispiele
Beispiele: CNCL_Polynom
Die Klasse CNCL_Polynom ermöglicht das interpolieren von Werten nach unterschiedlichen Verfahren.
Dim a(0 To 3) As Double
Dim i As Double
Dim Polynom As CNCL_Polynom
' f(x) = 1·x
3 + 0·x
2 + 0·x + 0
a(0) = 1
a(1) = 0
a(2) = 0
a(3) = 0
Set Polynom = New CNCL_Polynom(a)
For i = -17 To 17
Print "x=" + CStr(i) + " f(x)=" + CStr(CNCL_Round(Polynom.f(i),3)) + " f'(x)=" + CStr(CNCL_Round(Polynom.derivative(1,i),3)) + " f""(x)=" + CStr(CNCL_Round(Polynom.derivative(2,i),3))
Next
Ausgabe:
x=-17 f(x)=-4913 f'(x)=867 f"(x)=-102
x=-16 f(x)=-4096 f'(x)=768 f"(x)=-96
x=-15 f(x)=-3375 f'(x)=675 f"(x)=-90
x=-14 f(x)=-2744 f'(x)=588 f"(x)=-84
x=-13 f(x)=-2197 f'(x)=507 f"(x)=-78
x=-12 f(x)=-1728 f'(x)=432 f"(x)=-72
x=-11 f(x)=-1331 f'(x)=363 f"(x)=-66
x=-10 f(x)=-1000 f'(x)=300 f"(x)=-60
x=-9 f(x)=-729 f'(x)=243 f"(x)=-54
x=-8 f(x)=-512 f'(x)=192 f"(x)=-48
x=-7 f(x)=-343 f'(x)=147 f"(x)=-42
x=-6 f(x)=-216 f'(x)=108 f"(x)=-36
x=-5 f(x)=-125 f'(x)=75 f"(x)=-30
x=-4 f(x)=-64 f'(x)=48 f"(x)=-24
x=-3 f(x)=-27 f'(x)=27 f"(x)=-18
x=-2 f(x)=-8 f'(x)=12 f"(x)=-12
x=-1 f(x)=-1 f'(x)=3 f"(x)=-6
x=0 f(x)=0 f'(x)=0 f"(x)=0
x=1 f(x)=1 f'(x)=3 f"(x)=6
x=2 f(x)=8 f'(x)=12 f"(x)=12
x=3 f(x)=27 f'(x)=27 f"(x)=18
x=4 f(x)=64 f'(x)=48 f"(x)=24
x=5 f(x)=125 f'(x)=75 f"(x)=30
x=6 f(x)=216 f'(x)=108 f"(x)=36
x=7 f(x)=343 f'(x)=147 f"(x)=42
x=8 f(x)=512 f'(x)=192 f"(x)=48
x=9 f(x)=729 f'(x)=243 f"(x)=54
x=10 f(x)=1000 f'(x)=300 f"(x)=60
x=11 f(x)=1331 f'(x)=363 f"(x)=66
x=12 f(x)=1728 f'(x)=432 f"(x)=72
x=13 f(x)=2197 f'(x)=507 f"(x)=78
x=14 f(x)=2744 f'(x)=588 f"(x)=84
x=15 f(x)=3375 f'(x)=675 f"(x)=90
x=16 f(x)=4096 f'(x)=768 f"(x)=96
x=17 f(x)=4913 f'(x)=867 f"(x)=102