chenting 发表于 2006-6-8 11:56:00

给定一个横坐标,怎么样延长一条曲线,使其得到纵坐标的值?

<P>我是新手,大家见笑了~我用vba编转桨式水轮机的特性曲线,如上传的图所示:横坐标634.2于5线没有交点,于是得到0,点就跑到坐标轴外面去了</P>
<P>&nbsp;zhuansu = TextBox31.Text</P>
<P>For k = 0 To zhuanjiao - 1</P>
<P>For i = 0 To kaidu(k) - 1</P>
<P>For j = 0 To shu(i, k) - 1<BR>n11(i, j) = n(i, j, k)<BR>discharge(i, j) = q11(i, j, k)<BR>kai(i, j) = a0(i, j, k)</P>
<P>Next j</P>
<P>Dim points(0 To 2001) As Double<BR>Dim f As Double<BR>Dim p As Double, q1 As Double</P>
<P><BR>p = 600 / (qmax - qmin)<BR>q1 = 350 / (a0max - a0min)</P>
<P>For l = 0 To shu(i, k) - 1<BR>discharge1(l) = discharge(i, l)<BR>n11a(l) = n11(i, l)<BR>Next l</P>

<P>If n11a(0) &lt;= zhuansu And zhuansu &lt;= n11a(shu(i, k) - 1) Then</P>
<P>'------------------------------------------利用反插值函数求出单位转速对应的单位流量值<BR>&nbsp;&nbsp; x1(i) = xfactor(discharge1(), n11a(), shu(i, k) - 1, zhuansu, discharge1(0), discharge1(shu(i, k) - 1))<BR>&nbsp;&nbsp; y1(i) = kai(i, 0)<BR>&nbsp;<BR>pt1(0) = (x1(i) - qmin) * p<BR>pt1(1) = (kai(i, 0) - a0min) * q1<BR>pt1(2) = 0</P>
<P>Set circleobj = ThisDrawing.ModelSpace.AddCircle(pt1, 2)</P>
<P>End If</P>
<P>Next i<BR>For i = 0 To kaidu(k) - 1</P>
<P>f = (x1(kaidu(k) - 1) - x1(0)) / 1000</P>
<P>&nbsp;m = 0</P>
<P>For e = 0 To 1000<BR>points(m) = (x1(0) + e * f - qmin) * p<BR>points(m + 1) = (TPspline(x1(), y1(), kaidu(k) - 1, x1(0) + e * f) - a0min) * q1</P>
<P>m = m + 2<BR>Next e<BR>Set plineobj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)<BR>plineobj.Lineweight = acLnWt040<BR>Next i</P>
<P>pt1(0) = (x1(0) - qmin) * p - 5<BR>pt1(1) = (kai(0, 0) - a0min) * q1 + 8<BR>pt1(2) = 0<BR>x = k + 1<BR>Set textobj = ThisDrawing.ModelSpace.AddText(Str$(x), pt1, 5)</P>
<P>If x1(0) &lt;= xlq(k) &lt;= x1(kaidu(k) - 1) Then</P>
<P>xla(k) = xfactor(y1(), x1(), kaidu(k) - 1, xlq(k), y1(0), y1(kaidu(k) - 1))<BR>End If</P>
<P>If xlq(k) &lt; x1(0)&nbsp;&nbsp;&nbsp; Then<BR><FONT color=#f70909>&nbsp;??????????</FONT>&nbsp;<BR>End If</P>
<P>&nbsp;Next k</P>
<P>这就不会编了,想延长曲线求其交点的横坐标。</P>
页: [1]
查看完整版本: 给定一个横坐标,怎么样延长一条曲线,使其得到纵坐标的值?