Question

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.

Was it helpful?

Solution 2

You want

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

Dy is y coordinate of D

Cy is y coordinate of C

AB is length of AB

angle-AB is angle of AB relative to horizontal line

OTHER TIPS

Please clarify what you are asking:

You've initially said you know the angles between the lines and horizontal

I know their x, y co-ordinates and the angles they make with the horizontal plane.

but then you ask for them in the question?

how to find the required angle between AB and the horizontal plane

Plus AB and CD lengths must be changed to form a parallelogram (as parallelogram has opposite sides equal in length and parallel)

The distance between any of the points should not be changed. Can't be true

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top