求过直线端点作垂线
本帖最后由 作者 于 2009-3-10 22:52:35 编辑 <br /><br /> <p></p><p></p><p>已知p1-Pa线段长度为5,夹角为10度</p><p>用Kp1-pa = deltaY/deltaX</p><p>oo-pa线段斜率为Koo-pa = -1/Kp1-pa</p><p>alfa = 10 * Atn(1)*4/180</p><p>PaX= 5*cos(Alfa) = 4.924039</p><p>PaY = 5 * Sin(Alfa) = 0.868241</p><p>Kp1-pa= 5.6713</p><p>Koo-pa = -1/ Kp1-pa = -0.763</p><p>OOy = -PaX * Koo-pa = 28.79385</p><p></p><p> </p> 本帖最后由 作者 于 2009-3-11 22:07:54 编辑Sub ls()
Dim l As AcadLine
Dim Pp(2) As Double
Dim Ang, Ang1
With ThisDrawing
Set l = .HandleToObject("151")
With l
'Debug.Print l.EndPoint(0)
Kab = .Delta(0) / .Delta(1)
K0 = -1 / Kab
y = -.EndPoint(0) / K0 + .Delta(1)
Ang = -Atn(1) * 2 + 2 * .Angle
'Debug.Print 90 + Ang * 180 / (Atn(1) * 4)
Ang1 = -Atn(1) * 2 - 2 * .Angle
Pp(0) = 0: Pp(1) = y / 2
End With
''
Dim objArc As AcadArc
Set objArc = .ModelSpace.AddArc(Pp, y / 2, Ang1, Ang)
End With
End Sub
<p>好! 需要这个</p> To <strong><font face="Verdana" color="#61b713">ningyong58</font></strong>:<br/><p>OOy = 5/sin(10*atn(1)*4/180)<br/>就可以了,不要这么复杂。</p> 哪位能提供个源码
页:
[1]