Sub Make_Tline(x, y, Center_x, Center_y, Rr, T1x, T1y, T2x, T2y)
'======================
' 任意の点P(x,y)から円 半径Rr 中心座標(Center_x, Center_y)
' に引いた接線の接点および点pの接点に対する対称点の座標
'======================

Dim l As Single
Dim m As Single
Dim alfa As Single
Dim theta As Single
Dim P1x As Single
Dim P1y As Single
Dim Cx As Single
Dim Cy As Single
Dim s1x As Single
Dim s1y As Single
Dim s2x As Single
Dim s2y As Single
Dim R As Single

P1x = x
P1y = y
Cx = Center_x
Cy = Center_y
R = Rr

l = Sqr((Cx - P1x) ^ 2 + (Cy - P1y) ^ 2)
alfa = Atn((Cy - P1y) / (Cx - P1x))
theta = Arcsin(R / l)

m = Sqr(l ^ 2 - R ^ 2)

s1x = Px + m * Cos(alfa + theta)
s1y = Px + m * Sin(alfa + theta)
s2x = Px + m * (alfa - theta)
s2y = Px + m * (alfa - theta)

T1x = s1x
T1y = s1y
T2x = s2x
T2y = s2y

'Debug.Print "接点" & s1x & " / " & s1y
'Debug.Print "端点" & s2x & " / " & s2y

End Sub