测量沿椭圆的距离
假设我们有一个椭圆 x^2/a^2 + y^2/b^2 。
取椭圆上的一点 (a*cos(t),b*sint(t)),找到椭圆上另一个点且它们之间的距离为给定 d 的最快方法是什么。 [d 小于 pi*a*b]。
当我有一个角[四分之一椭圆]并且需要找到沿它由一些“d”分隔的点时遇到了问题。
Suppose we have an ellipse x^2/a^2 + y^2/b^2 .
Taking a point (a*cos(t),b*sint(t)) on the ellipse, what is the fastest way to find another point on the ellipse such that distance between them is a given d. [d is less than pi*a*b].
The problem was encountered when i have a corner [quarter ellipse] and need to find points along it seperated by some 'd'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
椭圆的分段长度是椭圆积分,没有封闭解。
为了计算沿椭圆的距离,您将需要一个数值积分例程。我推荐 Romberg 或高斯求积(在维基百科上查找)。如果您重复执行此操作,请预先计算椭圆周围一堆点的距离,以便您可以快速到达正确的区域,然后开始积分。
您需要平分(在维基百科上查找)才能找到所需的长度。
The length of a subsection of an ellipse is an elliptic integral, with no closed form solution.
In order to compute the distance along the ellipse, you will need a numerical integration routine. I recommend Romberg, or Gauss Quadrature (look up on Wikipedia). If you are doing this repeatedly, then precompute the distance across a bunch of points around the Ellipse so that you can rapidly get to the right region, then start integrating.
You will need to bisect (look up on Wikipedia) to find the desired length.
椭圆弧的长度没有解析解。这意味着您将无法将数字代入方程来找到结果,而是使用数值积分方法。
辛普森规则非常容易实现,尽管很可能比方法慢其他答案中提到过。
现在您已经找到了椭圆弧长度的方法,只需测量不同的端点,直到找到长度 d 的一个达到可接受的公差
There is no analytical solution for the length of an elliptical arc. This means you won't be able to plug numbers into an equation to find a result, but instead use a method of numerical integration.
Simpsons rule is very easy to implement although most likely slower than the methods mentioned in other answers.
Now that you have a way to find the length of an elliptical arc, just measure different end points until you find one of length d to some acceptable tolerance