Hello .
This program was written in vb , I want to run the program on macro from the Gcode.
the mach3 editor ,does not get it .
I really thanked those who could help repair program.
Function FindIntersection(px11 As Single, py11 As Single, px12 As Single, py12 As Single, px21 As Single, py21 As Single, px22 As Single, py22 As Single) As String
Dim dx1 As Single
Dim dy1 As Single
Dim dx2 As Single
Dim dy2 As Single
Dim t1 As Single
Dim t2 As Single
Dim nUl As Single
On Error GoTo err
dx1 = px12 - px11 ' calulates dx,dy for each point
dy1 = py12 - py11
dx2 = px22 - px21
dy2 = py22 - py21
nUl = (dy1 * dx2 - dx1 * dy2)
t1 = ((px11 - px21) * dy2 + (py21 - py11) * dx2) / nUl
t2 = ((px21 - px11) * dy1 + (py11 - py21) * dx1) / -nUl
nInter_x = px11 + dx1 * t1 'X point
nInter_y = py11 + dy1 * t1 'Y point
FindIntersection = Round(inter_x, 2) & "," & Round(inter_y, 2)
err:
If err.Number = 11 Then Label1.Caption = "parallel lines"
End Function