Specific equilateral triangle given two points in 3D

247 Views Asked by At

Let's say I have two points: $A = (x_0, y_0, z_0)$ and $B = (x_1, y_1, z_1)$.

How can I find a third point $C = (x_2, y_2, z_2)$ such that:
a) $A$, $B$ & $C$ form an equilateral triangle
b) the value of $z_2$ is the highest it can be

Thanks a lot for your time :)

I've tried some examples with pre-set points, forming non-linear systems of equations $AC$, $BC$, $DC$ ($D$ being the midpoint of $AB$) and then doing some partial derivatives on these results. I got what I was looking for for some specific example (where $z_0 = z_1 = 0$) but am sort of doing it headlessly until I get what I want and that hasn't worked out for me for more complicated examples (like when $z_0\ne z_1$).

1

There are 1 best solutions below

8
On BEST ANSWER

Hint.

enter image description here

Special cases aside, let $A_z>B_z$. Consider the point $D=(x_1,y_1,z_0)$. $\triangle ADB$ defines the plane where the sought point $C$ would be located. Use cross-product of $\vec{AB}$ and $\vec{DB}$ to rotate $A$ by $60^\circ$ around $B$.


Edit

For example, in terms of a powerful descriptive vector graphics language Asymptote it would be just

triple C=rotate(60,B,B+cross(A-B,D-B))*A;