distance between opposite sides of a Quadrilateral at a given angle

129 Views Asked by At

enter image description here

Hi, I am in need of estimating the distance between the two opposite sides of a quadrilateral as shown in the image. I know the coordinates of P_0, P_1, P_2, P_3 and P_4 points. I need to find the lengths of the "red" and "orange" lines that are orthogonal to each other. The angle "\alpha" is known as well.

In the past, I dealt with 2D coordinate system, where the there was no z coordinate. I dealt with (a) line equations and (b) intersection of lines concepts to estimate the length of red and orange lines.

However, when it comes to 3D coordinate system, things are same analogy (as in 2D) seems to be tricky. Is there any other way.

I need to program this in FORTRAN.

Thanks in advance.

Edits summary:

Edit1: Yes, All the points (P0 through P4) are co-planar i.e. form a quadrilateral plane. The red and the orange lines also lie in the quadrilateral plane. However, this quadrilateral plane is oriented in a 3D space.

1

There are 1 best solutions below

1
Nguyen Duc On

If you already have the result on 2D case, it is better to transform this problem into that case by using the transformation P(x,y,z) --> P(x/z, y/z, 1). It can be seen as the projection this plan into the plane z = 1. You also need to think about the case one z_i = 0; so if(z_i == 0)( z_i + = 1) then redo the previous process. In the case of 2D, we only need a function calculate the intersection between two lines and a distance function. I know that this is better to be in comment section but I dont have enough reputation to add a comment, I am new in this group. Sorry!