如何在给定外接矩形的情况下找到椭圆长轴的旋转角度?
我有一个以 (0,0) 为中心的椭圆,边界矩形为 x = [-5,5],y = [-6,6]。 椭圆与矩形相交于 (-5,3)、(-2.5,6)、(2.5,-6) 和 (5,-3)
我对椭圆一无所知,但我唯一需要知道的是主轴旋转的角度。
看起来答案一定很简单,但我只是没有看到它......感谢您的帮助!
I have an ellipse centered at (0,0) and the bounding rectangle is x = [-5,5], y = [-6,6]. The ellipse intersects the rectangle at (-5,3),(-2.5,6),(2.5,-6),and (5,-3)
I know nothing else about the ellipse, but the only thing I need to know is what angle the major axis is rotated at.
seems like the answer must be really simple but I'm just not seeing it... thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果 (0, 0) 是中心,则椭圆的方程为:
F(x, y) = Ax^2 +By^2 + Cxy + D = 0
对于任何给定的椭圆,并非所有系数 A、B 、C和D是唯一确定的。 可以将该方程乘以任何非零常数并获得同一椭圆的新方程。
你有 4 个点,给你 4 个方程,但由于这些点是两对对称点,所以这些方程不会独立。 你会得到2个独立的方程。 利用椭圆与软管点中的矩形相切的事实,您可以得到另外两个方程(这就是我的理解)。
因此,如果 F(x, y) = Ax^2 +By^2 + Cxy + D 您的条件是:
dF/dx = 0 点 (-2.5,6) 和 (2.5,-6)
dF/dy = 0 在点 (-5,3) 和 (5,-3) 中
得到的四个线性方程
这是经过一些清理后
:仍然不是所有 4 个方程都是独立的,这是一件好事。 该集合是同质的,如果它们是独立的,您将得到唯一但无用的解决方案 A = 0,B = 0,C = 0,D = 0。
正如我之前所说,系数不是唯一确定的,因此您可以设置其中一个系数如你所愿并摆脱一个方程式。 例如,
从中你可以得到:A = 4/75,B = 1/27,C = 2/45(D当然是-1)
现在,为了得到角度,应用坐标变换:(
我只是不能不要抗拒使用这些字母:) )
方程 F(x, y) = 0
使用这两个恒等式:
您将得到系数 C',它表示 G(xi, η) 中的乘积 xiη 为:
C' = (BA)sin(2φ) + Ccos (2φ)
现在你的问题是:对于什么角度 φ 系数 C' 消失(等于零)
由于存在多个轴,因此存在多个角度 φ。 在主轴线B'>的情况下, A'
If (0, 0) is the center, than equation of Your ellipse is:
F(x, y) = Ax^2 +By^2 + Cxy + D = 0
For any given ellipse, not all of the coefficients A, B, C and D are uniquely determined. One can multiply the equation by any nonzero constant and obtain new equation of the same ellipse.
4 points You have, give You 4 equations, but since those points are two pairs of symmetrical points, those equations won't be independent. You will get 2 independent equations. You can get 2 more equations by using the fact, that the ellipse is tangent to the rectangle in hose points (that's how I understand it).
So if F(x, y) = Ax^2 +By^2 + Cxy + D Your conditions are:
dF/dx = 0 in points (-2.5,6) and (2.5,-6)
dF/dy = 0 in points (-5,3) and (5,-3)
Here are four linear equations that You get
After a bit of cleaning:
Still not all 4 equations are independent and that's a good thing. The set is homogeneous and if they were independent You would get unique but useless solution A = 0, B = 0, C = 0, D = 0.
As I said before coefficients are not uniquely determined, so You can set one of the coefficient as You like and get rid of one equation. For example
From that You get: A = 4/75, B = 1/27, C = 2/45 (D is of course -1)
Now, to get to the angle, apply transformation of the coordinates:
(I just couldn't resist to use those letters :) )
to the equation F(x, y) = 0
Using those two identities:
You will get coefficient C' that stands by the product ξη in G(ξ, η) to be:
C' = (B-A)sin(2φ) + Ccos(2φ)
Now your question is: For what angle φ coefficient C' disappears (equals zero)
There is more than one angle φ as there is more than one axis. In case of the main axis B' > A'
椭圆的梯度与沿椭圆一侧的边界矩形相交的梯度相同。 就您而言,这是从 (-2.5,6) 到 (5,-3) 的线,即椭圆的顶边。 该线的垂直落差为 9,水平落差为 7.5。
所以我们最终得到下面的直角三角形。
我们要寻找的角度是 x,它在两个位置都是相同的。
我们可以将其计算为:
角度为 -50.19 度
The gradient of the ellipse is identical to the gradient of the intersects with the bounding rectangle along one side of the ellipse. In your case, that's the line from (-2.5,6) to (5,-3), the top side of your ellipse. That line has a vertical drop of 9 and a horizontal run of 7.5.
So we end up with the following right-angled triangle.
The angle we're looking for is x which is the same in both locations.
We can calculate it as:
which gives us an angle of -50.19 degrees
我使用类似的方法来计算另一个椭圆问题:
如果误差太大, net/2008/07/18/a-mathematical-digression/" rel="nofollow noreferrer">http://successfulsoftware.net/2008/07/18/a-mathematical-digression/
http://successfulsoftware.net/2008/08/25/a-mathematical-digression -revisited/
另请参阅:
http://en.wikipedia.org/wiki/Secant_method< /a>
http://en.wikipedia.org/wiki/Newton_Rhapson
I used a similar approach to work out another ellipse problem:
http://successfulsoftware.net/2008/07/18/a-mathematical-digression/
http://successfulsoftware.net/2008/08/25/a-mathematical-digression-revisited/
See also:
http://en.wikipedia.org/wiki/Secant_method
http://en.wikipedia.org/wiki/Newton_Rhapson