0
$\begingroup$

I have a trapezoid with all the coordinates A(x1,y1), B(x2,y2), C(x3,y3), D(x4,y4) along with Widths W1,W2 and Lengths L1,L2. So what I need is, if I increase width W2 then I should get new coordinates N(xn,yn) with same angle ADC. Point C will become N. Even if ABCD is in clockwise or anticlockwise the coordinates should be accurate.

trapezoid

//values of trapezopid are
A(1026.5718, 441.5417)
B(1023.2499, 401.6799)
C(855.8303, 415.6316)
D(859.1521, 455.4934)
W1 = 40, W2 = 40, L1 = 168, L2 varies according to the W2 changed.

I used the below formula but it didn't give accurate values. In the above case it failed.

Nx = X4 + (W2/W1) * (X2 - X1)
Ny = Y4 + (W2/W1) * (Y2 - Y1)
$\endgroup$

1 Answer 1

0
$\begingroup$

If you just want to change point C and length W2, (which is between D and C) the new point N will be predicted as

$$\left(\begin{array}{c} N_{x}\\ N_{y} \end{array}\right)=\left(\begin{array}{c} D_{x}\\ D_{y} \end{array}\right)+W_{2}\cdot\frac{C-D}{\Vert C-D\Vert}=\left(\begin{array}{c} D_{x}\\ D_{y} \end{array}\right)+W_{2}\left[\begin{array}{c} \frac{C_{x}-D_{x}}{\sqrt{\left(C_{x}-D_{x}\right)^{2}+\left(C_{y}-D_{y}\right)^{2}}}\\ \frac{C_{y}-D_{y}}{\sqrt{\left(C_{x}-D_{x}\right)^{2}+\left(C_{y}-D_{y}\right)^{2}}} \end{array}\right]$$

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .