fb:porticula NoPaste
Kurve
Uploader: | St_W |
Datum/Zeit: | 15.06.2014 16:11:27 |
ScreenRes 620, 420, 32
Function funcAt(x As Single) As Single
Return (x/10)^2
End Function
Sub drawParametrizedCurveAt(dx As Integer, dy As Integer, param As Single)
Dim As Integer fromX = -310, toX = 310
Dim As Integer y, lastX, lastY
lastY = funcAt(fromX)
lastX = fromX
'axes
Line (dx, 0)-(dx, 400), &H555555
Line (0, dy)-(620, dy), &H555555
For x As Integer = fromX To toX
y = funcAt(param*x)
Line (dx+lastX, dy-lastY)-(dx+x, dy-y), &Hffffff
lastX = x
lastY = y
Next
End Sub
Dim param As Single = 1.0
Dim animDir As Integer = 1
Do
param += 0.005*animDir
ScreenLock
cls
drawParametrizedCurveAt(300, 400, param)
ScreenUnLock
Sleep 10
If param >= 2 Then animDir = -1
If param <= 0.5 Then animDir = 1
Loop Until InKey <> ""