Option Explicit
Const Pi As Double = 3.14159265358979
Const X As Long = 150
Const Y As Long = 150
Const z1 As Long = 120
Const z2 As Long = 120
Private Sub Form_Load()
Dim Ang As Double
Line (z1, z2)-(X, Y)
Ang = Angle(z1, z2, X, Y)
Line (X, Y)-(-xX(20, Pi / 4 + Ang) + X, -yY(20, Pi / 4 + Ang) + Y)
Line (X, Y)-(-xX(20, Pi / 4 - Ang) + X, yY(20, Pi / 4 - Ang) + Y)
End Sub
Public Function Angle(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Double
Angle = Atn((y2 - y1) / (x2 - x1))
End Function
Public Function yY(ByVal LLen As Long, ByVal Ang As Double) As Double
yY = LLen * Sin(Ang)
End Function
Public Function xX(ByVal LLen As Long, ByVal Ang As Double) As Double
xX = LLen * Cos(Ang)
End Function
Не знаю как я это написал )) НО работает только на промежутке (Pi/2;-Pi/2). Мысль дальше не хочет идти...
Private Sub Arrow(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, Optional ArrowLen As Long = 10, Optional ArrowAng As Double = Pi / 4)
Dim Ang As Double
Line (x1, y1)-(x2, y2)
If x2 - x1 = 0 Then Ang = Pi / 2 Else Ang = Atn((y2 - y1) / (x2 - x1))
If x2 - x1 <> 0 Then
Line (x2, y2)-(Sgn(x1 - x2) * ArrowLen * Cos(ArrowAng + Ang) + x2, Sgn(x1 - x2) * ArrowLen * Sin(ArrowAng + Ang) + y2)
Line (x2, y2)-(Sgn(x1 - x2) * ArrowLen * Cos(ArrowAng - Ang) + x2, -Sgn(x1 - x2) * ArrowLen * Sin(ArrowAng - Ang) + y2)
Else
Line (x2, y2)-(ArrowLen * Cos(ArrowAng + Ang) + x2, Sgn(y1 - y2) * ArrowLen * Sin(ArrowAng + Ang) + y2)
Line (x2, y2)-(ArrowLen * Cos(ArrowAng - Ang) + x2, -Sgn(y1 - y2) * ArrowLen * Sin(ArrowAng - Ang) + y2)
End If
End Sub
Вот как то так... как работает сам не знаю...
написал методом брутфорса ))