C点垂直-线段AB的B点
<p></p><p>图示,求C点到AB线段的垂线,且交点于B点.</p><p>A点: X = 0.0000 Y = 1.0000 Z = 0.0000</p><p>B点: X = 2.0000 Y = 3.0000 Z = 0.0000</p><p>要求通过解析几何算法<font color="#f73809">,求C点坐标, (通过作图得出C点坐标为 X = 2.7071 Y = 2.2929 Z = 0.0000)<br/></font></p> <p>找到解法了</p><p>已知Kab=1.7 那么Kbc=-1/Kab=-.588235294117647 <br/>再用x^2+y^2=R^2公式推导 <br/>x = r/sqrt(1+Kbc^2) <br/>y = r/ sqrt ( 1+ (1/Kbc)^2) <br/>调试通过的程序如下: <br/>Sub LSs() <br/> Dim Aa(2) As Variant <br/> Aa(0) = Array(10, 33) <br/> Aa(1) = Array(20, 50) <br/> Dim pp(0 To 2) As Double, ppp(0 To 2) As Double <br/> Dim kkk As Double <br/> Kab = (Aa(1)(1) - Aa(0)(1)) / (Aa(1)(0) - Aa(0)(0)) <br/> kkk = -1 / Kab <br/> For jj = 0 To 1 <br/> pp(jj) = Aa(1)(jj) <br/> Next jj <br/> ppp(0) = pp(0) + 5 / Sqr(1 + kkk ^ 2) <br/> ppp(1) = pp(1) - 5 / Sqr(1 + (1 / kkk) ^ 2) <br/> Set ll = ThisDrawing.ModelSpace.AddLine(pp, ppp) <br/> ll.color = 1 <br/>End Sub <br/></p>
页:
[1]