1

I am given eight coordinate points in xyz plane, how can I verify that they form a cube?

Thanks,

hai qi
  • 43
  • 2
  • 1
    Welcome to MathSE! You are more likely to get a good answer to your question if you follow a few guidelines. In particular, what have you tried so far, and just where are you stuck? This is not a homework-answering site: we want to see that you have put some work into the problem. – Frentos Jan 28 '16 at 00:51
  • Are the eight points supposed to be the vertices of the cube? – JRN Jan 28 '16 at 01:08
  • 2
    Also, what is an "xyz plane"? – JRN Jan 28 '16 at 01:08
  • You could calculate the Continuous Symmetry Measure for cubic symmetry using the SHAPE program. Although specifically designed for molecules, you can use it for any set of points you want. See link – JLT Sep 08 '20 at 10:09

2 Answers2

2

In computer graphics one can find some amazing, non-trivial and very efficient tests (see chapter $16$ of the Real-Time Rendering book, for what I mean by this).

I do not claim to have such a solution.

What you could do is to test for certain properties of a cube.

cube (Source) another cube (Large Version)

  • only certain distances should show up if you calculate the symmetric matrix of distances $$ d_{ij} = \lVert u_i - u_j \rVert $$ where $u_i = (x_i, y_i, z_i)^T$, like base length $a$, face diagonal length $\sqrt{2} \, a$, volume diagonal length $\sqrt{3} \, a$. For faster calculation, one might stick with the squared distances $d_{ij}^2 = \lVert u_i - u_j \rVert^2$ and check for the occurrence of $0$, $a^2$, $2 a^2$ and $3 a^2$ entries only, in the proper amounts (see below).
  • the smallest non-zero distance should give the base length $a$
  • there should be $8$ distinct vertices $u_i$ (only the diagonal entries $d_{ii}$ should be zero)
  • of the $(8\cdot 8 - 8)/2 = 28$ distinct segments $(u_i, u_j)$ with $i < j$, $s_{ij} = u_i - u_j$ there should be
    • $12$ distinct segments of base length $a$
    • $6\cdot 2 = 12$ distinct face diagonals
    • $4$ distinct volume diagonals
  • the $i$-th row of $d_{ij}$ should contain
    • one zero at $d_{ii}$
    • three base length entries
    • three face diagonal entries
    • one volume diagonal entry
  • the same counts should occur for the $i$-th column
  • relative angles between segments
    • line segments of base length $a$ should have relative angles of $0^\circ$, $\pm 90^\circ$, $180^\circ$ only, or $\cos \varphi = (s_{ij} \cdot s_{kl})/ a^2 \in \{ 0, \pm 1 \}$
    • face diagonals have relative angles of $0^\circ$, $\pm 90^\circ$, $180^\circ$, $\pm 60^\circ$
    • volume diagonals have relative angles $\cos \varphi = \pm (1/3)$

The general idea is to come up with a list of properties that fully characterize a cube, i.e. if all are fulfilled it can only be a cube. If at least one property is not fulfilled, it can not be a cube.

For efficiency one should sort the list of properties such that the most discriminating ones are tested first.

mvw
  • 34,562
1

You can check with vectors. Suppose you are at a corner of the cube and you have these 3 vectors popping out of the corner corresponding to the 3 edges:

$\vec a=\begin{pmatrix}x_1\\y_1\\ z_1\end{pmatrix}, \vec b=\begin{pmatrix}x_2\\y_2\\ z_2\end{pmatrix},\vec c=\begin{pmatrix}x_3\\y_3\\ z_3\end{pmatrix}$

You want the vectors to have the same length so : $|\vec a|=|\vec b|=|\vec c|$

$|\vec a|= \sqrt{x^2+y^2+z^2} $

So, check if they have the same length.

Afterwards you need to show that the vectorial product $ \vec a \times \vec b $ is parallel to vector $\vec c$. You can calculate the vectorial product using determinants. To check if $ \vec a \times \vec b $ is parallel to $\vec c$ check if their coordinates are proportional.This would mean that $ \space \space \vec c$ is perpendicular to the plane set by vectors $\vec a, \vec b $.

Finally you need to show that the angle betwenn $\vec a$ and $ \vec b$ is 90 degrees.

$ |\vec a \times \vec b|= |\vec a| \cdot |\vec b| \cdot sin \theta$ , $\theta$ being the angle between vectors $ \vec a $ and $ \vec b$. So, $ sin\theta = \frac{|\vec a \times \vec b|}{|\vec a| \cdot |\vec b|}$ Use your solution from the previous step to find $|\vec a| \cdot |\vec b|$. You should have $sin \theta = 1$

odin19
  • 61
  • 4
  • Is it enough to check this from only one corner? From how many corners would I have to do this? – hai qi Jan 29 '16 at 01:35
  • You don't have to check for all corners. You can do the procedure on one corner and find that the vectors at the other corners are parallel and have the same length as the three vectors at the first corner. If so, they satisfy the same properties, so then you have proven it is a cube. – odin19 Jan 29 '16 at 12:24