I am trying to use plotly to make a 3D plot of a geometrical setup of a medical imaging system, and I cannot figure out how to solve for the geometry. Picture 2 shows a side view of the setup. Essentially, I need to find the coordinates of the corners of plane BC so that I can draw lines to them. I know the coordinates of plane DE, and plane FG, and I know the distances a and b. The triangle ABC formed by the side profile is only there for show. The entire thing forms a square pyramid. My attempt at the plot is shown in fig. 1, and as you can see, I did something because the lines dont go through the corners of plane FG (green). The lines should start at the corners of plane DE (blue), go through the corners of plane FG, then end up at the distance a (from plane DE) which in my setup is at z = 0. I won't show my plotly code because I am not having trouble plotting, just in the calculation of the lines and the corners of the plane BC.
My 3D plot showing the lines. It seems some angle is wrong.
The image of what I am trying to find: size of BC
code (function parameters det_corner represents a corner of plane DE and mask_corner represents a corner of plane FG, given as [x,y,z]. The function should return the coordinates of the corner of plane BC given by drawing a intersection the respective corner of plane DE and passing through the same corner of plane FG. My system is setup so that the center of plane BC should be at [0,0,0], and thus the z value for each corner should be 0. It is however not the case. Im getting something like 150
def find_corner(self, det_corner, mask_corner, a, b):
length = np.sqrt((det_corner[0] - mask_corner[0])**2 + (det_corner[1]-mask_corner[1])**2 + (det_corner[2]-mask_corner[2])**2)
slope = (mask_corner - det_corner) / length # unit slope
theta = np.arccos(b / length)
length_mask_obj_plane = (a + b)*np.cos(theta)
new_pt = det_corner + slope*length_mask_obj_plane
return new_pt # output should be [x,y,z] and z = 0 (if math is correct)

