[Math] Find corners of a square in a plane in 3d space

3dcirclessolid-geometryvectors

I am given two angles (similar to theta and phi in spherical coordinates) from which I can calculate a normal vector to a plane in 3d space. I am also given the center point of the square and the area of the square. Similar to the graphic shown here. Is there a way that I can define four corner points in 3d space?

I found this question here from which it seems the answer is no, but does it mater if I don't care where the corners exactly lie? For instance, is it possible to define the equation of a circle lying in the plane that would contain the corners of the square on its edge? Then points could be chosen (randomly to start?) 90 degrees apart along the circle?

Thanks for any assistance.

Best Answer

Given the area $A$ of a square you can find its circumradius $R$:

$$R = \sqrt{\frac{A}{2}}$$

Then you need two vectors known to be perpendicular to the normal and thus in the plane. The easiest way to do this is to

  1. use a basis vector such as $\mathbf x$ that is not the normal and cross it with the normal to get $\vec v$ (if $\mathbb x$ is the normal, then $\mathbf y$ and $\mathbf z$ are in the plane and you can proceed from there);
  2. cross that vector with the normal to get $\vec u$.

Turn these into unit vectors and then multiply by the circumradius. Then, from the given point $\vec p$, $\vec p \pm R\hat u$ and $\vec p \pm R\hat v$ are your four corners.

You have a degree of freedom, here; any unit vector perpendicular to the normal generates a square. You can get these other unit vectors by combining the originals with some simple trig: $\vec u' = \vec u\cos\theta+\vec v\sin\theta$ and $\vec v' = -\vec u\sin\theta+\vec v\cos\theta$