怎样在vb上 画一个二元一次方程的图 求编码

1个回答

  • Private Sub Command1_Click()

    zhixian 1,2,3

    End Sub

    Sub zhixian(A As Single,B As Single,C As Single)

    'Ax+By+C=0

    Dim x1 As Single,y1 As Single

    Dim x2 As Single,y2 As Single

    x0 = 1000

    y0 = 1000

    x1 = -500

    y1 = (-C - A * x1) / B

    x1 = x1 + x0

    y1 = y1 + y0

    x2 = 500

    y2 = (-C - A * x2) / B

    x2 = x2 + x0

    y2 = y2 + y0

    Line (0,1000)-(2000,1000)

    Line (1000,0)-(1000,2000)

    Line (x1,y1)-(x2,y2)

    End Su