I have this simple 3D geometry problem that I need to solve in order to go to the next step with a python script. Please check the attached image. here is what I know :
- A, B coordinates (X,Y, Z)
- A and B always have the same Z
- The distance AB therefore can be calculated
- The alpha angle which the segments BD and AC make with the plane (P1)
- The elevation of C and D( Z coordinates of C and D, both of them always have the same Z)
- ABCD is a rectangle I want to make an excel sheet in which I'll have A, B coords the angle alpha and the elevation of C and D as input and the output will be the X, Y, Z coords of C and D PS: Keep in mind that the rectangle can be in any orientation in 3D space there is no specific reference point. I m not really good at math I m a programmer so please use some value here are some raw data: A coords = 0,0,0 (x,y,z) B coords = 3,3,0 C Z coord = 5 D Z coord = 5 Alpha = 36°
Check this image.

Thanks for your help
As $AC$ is perpendicular to $AB$ we get a first equation: $$ (x_C-x_A)(x_B-x_A)+(y_C-y_A)(y_B-y_A)=0. $$ From $\tan\alpha=CH/AH$ (where $H$ is the projection of $C$ on plane $z=z_A$) we obtain a second equation: $$ (x_C-x_A)^2+(y_C-y_A)^2=(z_C-z_A)^2\cot^2\alpha. $$ It is not difficult to solve this system of equations for the unknowns $(x_C-x_A)$ and $(y_C-y_A)$. Apply the same technique to find $(x_D-x_B)$ and $(y_D-y_B)$.