Finding a point on a plane perpendicular to two other points on the same plane

484 Views Asked by At

I'm working on a 3D perspective game and it would help if you could answer this:

Plane $P$ is defined as: $xf \cdot x + yf \cdot y + zf \cdot z + G = 0$

I know point $p$ $(xp, yp, zp)$ and point $f$ $(xf, yf, zf)$, and they each lie on plane $P$.

$xf, yf, zf, G, xp, yp, zp$ are all known.

I am looking for some point $q$'s coordinates. Point $q$ lies on plane $P$. Angle pqf forms a right angle.

*NOTE *: $f$ is at the same height as $q$ ($zq = zf$) and $p$ is above $q$.

I tried to use the dot product rule as well as the intersection of three planes in order to find point q, but it seemed there were too many unknown variables (which doesn't make sense to me).

Please help! Thanks.

2

There are 2 best solutions below

1
On

You have three variables for the point $Q = (Q_x,Q_y,Q_z)$. You have that $\angle PQF$ is right angle hence $(P-Q) \cdot (F-Q) = 0$. Also you have that $Q_z = F_z$ and finally you have that $xf \cdot Q_x + yf \cdot Q_y + zf \cdot Q_z + G = 0$, as $Q$ lies on the plane. These three equation should give a solution (whenever possible) for $Q = (Q_x,Q_y,Q_z)$.

1
On

Any point (other than $p$ or $q$ themselves) on the circle that has $p$ and $q$ as endpoints of a diameter and lies within the plane will create the right angle you’re looking for. As a practical way finding such a point, rotate either $p$ or $q$ about the normal to the plane through their midpoint.

Alternatively, once you’ve found the midpoint $c$, you can use a series of cross products to find a vector that’s orthogonal to both the plane normal and $p-c$ (and also $q-c$). Adjust its length to equal $\|p-c\|$.