[求助]版主关于曲线曲率的问题;.net附件上传了
本帖最后由 作者 于 2010-2-9 8:08:04 编辑 <br /><br /> 我把vb.net下的代码改写成C#时 double ka = (double)kp(1) / (double)kp(0) - Math.PI / 2;<br/>错误:Error3 'kp' is a 'variable' but is used like a 'method';高手赐教一下,谢谢!!!<br/> 'vb <br/> Dim p As Point3d = cv.GetPointAtDist(i * len / n)<br/> Dim kp As Object = cv.GetFirstDerivative(cv.GetParameterAtDistance(i * len / n))<br/> Dim ka As Double = kp(1) / kp(0) - Math.PI / 2<br/> 'Double s = kp(1)<br/> Call AddText(p, "等分点\" & CStr(i), 3, ka, 1, 1)<br/>////////C#<br/>p =cv.GetPointAtDist (i * len / n);<br/> Object kp =(Object) cv.GetFirstDerivative(cv.GetParameterAtDistance(i * len / n));<br/> double ka = (double)kp(1) / (double)kp(0) - Math.PI / 2;<br/> AddText(p, "等分点" + i.ToString(), 3, ka, 1, 1); <p>Vector3d kp = cv.GetFirstDerivative(cv.GetParameterAtDistance(i * len / n));<br/>double ka = kp / kp - Math.PI / 2;//?奇怪的方式,可以解释下么?</p><p></p> <p>我也看不明白。</p><p> </p> <p> </p><p>我把vb.net放在附件了;版主运行一下看看</p><p>在vb.net中;源程序是这样定义的:</p><p>Dim kp As<strong> Object</strong> = <strong>cv.GetFirstDerivative(cv.GetParameterAtDistance(i * len / n))</strong><br/></p><p>Dim ka As Double = kp(1) / kp(0) - Math.PI / 2</p><p>此句在c#中不知怎样表示?<br/></p><p>在vb.net中 kp(1)与kp(0)是个double值;</p><p> </p> <p>二楼不是写了?</p><p>Curve.GetFirstDerivative Method</p><p>返回曲线的切向量</p> <strong><font face="Verdana" color="#da2549">太感谢lzh741206</font></strong>
页:
[1]