兰州人 发表于 2008-9-17 21:06:00

C点垂直-线段AB的B点

<p></p><p>图示,求C点到AB线段的垂线,且交点于B点.</p><p>A点:&nbsp; X = 0.0000&nbsp;&nbsp;&nbsp;&nbsp; Y = 1.0000&nbsp;&nbsp;&nbsp;&nbsp; Z = 0.0000</p><p>B点:&nbsp; X = 2.0000&nbsp;&nbsp;&nbsp;&nbsp; Y = 3.0000&nbsp;&nbsp;&nbsp;&nbsp; Z = 0.0000</p><p>要求通过解析几何算法<font color="#f73809">,求C点坐标, (通过作图得出C点坐标为 X = 2.7071&nbsp;&nbsp;&nbsp;&nbsp; Y = 2.2929&nbsp;&nbsp;&nbsp;&nbsp; Z = 0.0000)<br/></font></p>

兰州人 发表于 2008-9-18 12:08:00

<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/>&nbsp; Dim Aa(2) As Variant <br/>&nbsp; Aa(0) = Array(10, 33) <br/>&nbsp; Aa(1) = Array(20, 50) <br/>&nbsp; Dim pp(0 To 2) As Double, ppp(0 To 2) As Double <br/>&nbsp; Dim kkk As Double <br/>&nbsp; Kab = (Aa(1)(1) - Aa(0)(1)) / (Aa(1)(0) - Aa(0)(0)) <br/>&nbsp; kkk = -1 / Kab <br/>&nbsp; For jj = 0 To 1 <br/>&nbsp; &nbsp; pp(jj) = Aa(1)(jj) <br/>&nbsp; Next jj <br/>&nbsp; ppp(0) = pp(0) + 5 / Sqr(1 + kkk ^ 2)&nbsp;<br/>&nbsp; ppp(1) = pp(1) - 5 / Sqr(1 + (1 / kkk) ^ 2) <br/>&nbsp; Set ll = ThisDrawing.ModelSpace.AddLine(pp, ppp) <br/>&nbsp; ll.color = 1 <br/>End Sub <br/></p>
页: [1]
查看完整版本: C点垂直-线段AB的B点