0

Suppose that we have a world with an infinite number of cubes, each of which are 1x1x1 in size and have integral coordinates, e.g. (1, 2, 3)

Given that C is a cube at (XC, YC, ZC) and that P is a vertex of that cube with coordinates (XP, YP, ZP), what are the coordinates of the other 7 cubes that have the vertex P?

XC - XP = 0 or -1 and YC - YP = 0 or -1 and ZC - ZP = 0 or -1

Lucien
  • 115
  • How do you model the coordinates of a cube? Seemingly, you don't use the coordinates of the $8$ vertices whose convex hull the given cube is. So what do you do? Do you take the center as its coordinate? – Stefan Mesken Feb 28 '16 at 16:30
  • @Stefan, I take the "Lowest" vertex for its location, so that CP - XP is either 0 or -1 (and the same applies to the Y and Z) – Lucien Feb 28 '16 at 16:39

1 Answers1

0

Let's look at the cube with vertices $\{(0,0,0),(0,0,1),(0,1,0),(0,1,1),(1,0,0), (1,0,1), (1,1,0), (1,1,1) \}$. If I understand your comment, you would index this cube at $(0,0,0)$. The $7$ other cubes that share this vertex are indexed at $(-1,0,0)$, $(0,-1,0)$, $(0,-1,-1)$, $(0,0,-1)$, $(-1,0,-1)$, $(0,-1,-1)$, and $(-1,-1,-1)$.

Now given any vertex $P = (x,y,z)$, there are $8$ cubes sharing this vertex and these are indexed at $(x,y,z)$, $(x-1,y,z)$, $(x,y-1,z)$, $(x,y-1,z-1)$, $(x,y,z-1)$, $(x-1,y,z-1)$, $(x,y-1,z-1)$, and $(x-1,y-1,z-1)$ respectively. If we remove the index of the cube we started with ( namely $(X_C, Y_C, Z_C)$ in your notation ), the remaining indices yield the desired answer.

Stefan Mesken
  • 16,651