<-- Previous || Up || Next -->

Text Plot Sine Sample Sub
Math Arithmetic Class

Private Sub TextPlotSineSample()
    ' Plot F(X) = Sine(X)

    Dim avarNums() As Variant
    ReDim avarNums(0 To 2, 0 To 1024)

    Dim intPoint As Integer
    Dim dblX As Double
    For dblX = -8 To 8 Step 0.1
        intPoint = intPoint + 1
        avarNums(1, intPoint) = dblX
        avarNums(2, intPoint) = Sine(dblX)
    Next dblX

    ReDim Preserve avarNums(0 To 2, 0 To intPoint)

    Dim strTextPlot As String
    strTextPlot = TextPlot(avarNums, 12, 50)

    Debug.Print
    ' Comment each line of the plot so that it can be included within VB source code.
    Debug.Print "'  " & Replace(strTextPlot, vbCrLf, vbCrLf + "'  ")
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.