Sub Button1_Click
Dim a, b, c, d, e, f, g
Dim x1, y1, x2, y2, x3, y3
If Button1.Text = "Start" Then
Button1.Text = "X1"
lblx1.Text = x
lbly1.Text = y
Else If Button1.Text = "X1" Then
Button1.Text = "X2"
lblx2.Text = x
lbly2.Text = y
Else If Button1.Text = "X2" Then
Button1.Text = "X3 & Ergebniss"
lblx3.Text = x
lbly3.Text = y
x1 = lblx1.Text
y1 = lbly1.Text
x2 = lblx2.Text
y2 = lbly2.Text
x3 = lblx3.Text
y3 = lbly3.Text
a =((x3*x3-x1*x1+y3*y3-y1*y1)*(x2-x1)-(x2*x2-x1*x1+y2*y2-y1*y1)*(x3-x1))
b=2*((y3-y1)*(x2-x1)-(y2-y1)*(x3-x1))
c=a/b
d=((x2*x2-x1*x1)+(y2*y2-y1*y1)-2*c*(y2-y1))
e=2*(x2-x1)
f=d/e
g=Sqrt(((x1-f)*(x1-f))+((y1-c)*(y1-c)))*100000
lblErgebniss.Text = g
Else If Button1.Text = "X3 & Ergebniss" Then
Button1.Text = "Start"
lblx1.Text = 0
lbly1.Text = 0
lblx2.Text = 0
lbly2.Text = 0
lblx3.Text = 0
lbly3.Text = 0
lblErgebniss.Text = 0
End If
End Sub