Silverlight - 在 BezierSegment 上获得积分
我在 Silverlight 应用程序中使用 Path
类和 BezierSegment
。 我正在用它绘制不同的拱门和线条。
我想做的是得到我的拱门/线的中间。 我注意到 BezierSegment 没有经过第二点,而只是接近它。 如何获得真实的曲线点(其坐标)?
I am using the Path
class and a BezierSegment
in my Silverlight application.
I am drawing different arches and lines using it.
What I'd like to do is get the middle of the my arch / line.
I noticed that the BezierSegment
doesn't go through the second point, but merely comes near to it.
How can I get the real curve point (its coordinates) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BezierSegment 类使用三次贝塞尔曲线,并且 此维基百科页面给出了此类曲线的方程。您可以采用该方程并将 t = 0.5 代入其中以获得曲线上的某个点。
请注意,t = 0.5 处的点不能保证恰好位于曲线从起点到终点的中间位置。获取曲线的确切中点更为复杂,如果您确实需要它,最好在 https:// /math.stackexchange.com/。
The BezierSegment class uses cubic Bézier curves, and this Wikipedia page gives the equation of such curves. You can take this equation and put t = 0.5 into it to get a point somewhere on the curve.
Note that the point at t = 0.5 isn't guaranteed to be exactly half-way along the curve from the start to the end. Getting the exact midpoint of the curve is more complicated, and if you really need that, you'll be best off asking how to calculate it at https://math.stackexchange.com/.