0

I have 2 sets of points, say AB and CD. They may or may not be in a straight line. I know their x, y co-ordinates and the angles they make with the horizontal plane. I need to adjust the angle that line AB forms with the horizontal plane in such a way that the points AB are perfectly aligned with CD. Meaning, they form a trapezoid. The image will make it clearer:

enter image description here

Any ideas as how to find the required angle between AB and the horizontal plane? The distance between any of the points should not be changed.

Important: Since I'll be implementing the solution in a browser, all the co-ordinates are read from top, left = 0, 0. I'm rotating around the center, in a clockwise direction.

4

2 回答 2

1

请澄清你在问什么:

您最初说过您知道线和水平线之间的角度

我知道它们的 x、y 坐标以及它们与水平面的夹角。

但是你在问题中问他们?

如何找到AB与水平面之间所需的角度

加上 AB 和 CD 的长度必须改变以形成平行四边形(因为平行四边形的对边长度相等且平行)

任何点之间的距离不应改变。不可能是真的

于 2013-05-22T11:23:02.793 回答
0

你要

AB x sin angle-AB = Dy - Cy
angle-AB = arcsin((Dy - Cy)/AB)

Dy 是 D 的 y 坐标

Cy 是 C 的 y 坐标

AB 是 AB 的长度

angle-AB 是 AB 相对于水平线的角度

于 2013-05-22T10:55:14.540 回答