4d rotation into 3d shape I have a problem defined on the positive orthant of a unit hypercube.
I'm trying to develop a distance measurement between 2 points on the surface of said positive orthant.  On such a surface, all faces are pairwise adjacent.  I want to draw a chord between the two points, and calculate the length.  If the points are on the same face, then this is euclidean norm.  If they're on different faces, then it's more difficult.
This is similar to unfolding a net of a geometric shape, but, as stated, I'm on the positive orthant of the hypercube, so in $d$ dimensions there are only $d$ faces.
I've realized that it's more complex than merely proceeding to the adjacent face.
I'm trying to rotate the faces of said hypercube into a "d-1"-dimensional shape, such that I can draw a straight line from one point to the other, and the euclidean norm of the difference will serve as my distance (accepting that I will need to calculate this for every combination of interior faces...).  Really, I hope to prove that I never need transit over more than 1 interior face, but that's probably not possible.
In 3 dimensions, this is relatively simple.  the faces of the positive orthant of the hypercube (3) fold into 2 dimensions fairly straightforwardly.   In 4 dimensions, this is slightly more difficult.
Is there a already defined method of rotation that will do what I want to do?  Alternatively, is there already a defined distanced metric on the surface of the positive orthant of the hypercube?
 A: The "surface" of a hypercube with positive coordinates only will be four cubes, not faces.  Essentially you are restricted to have at least one coordinate equal to $1$ at all times as you draw the path from one point to another.
You definitely only need to pass through one boundary plane, unless it is something weird like already being on a boundary plane (having two coordinates equal to $1$ in your starting point, for example.). Even then, I don't see why you would ever want to move a coordinate away from its eventual goal, the changes should be monotonic.
Suppose you want the distance from $(0.1,0.2,0.3,1)$ to $(1, 0.5, 0.5, 0.6)$. Presumably you want a linear function along $0.1 \leq x \leq 1$, mapping to a point on the boundary plane between the $x=1$ cube and the $w = 1$ cube, with coordinates $(1,y_b, z_b, 1)$, and you want to choose $y_b$ and $z_b$ so as to minimize the sum of the distances in the two cubes.  I suspect it is a fairly simple proportionality to get a "geodesic" on your hyper-surface. You're drawing two line segments that meet at the boundary plane. In the example I gave, $x$ has to change by $0.9$, $y$ by $0.3$, and $z$ by $0.2$, while $w$ must change from $1$ to $0.6$, a change of $-0.4$.  The entire $x$ change must happen in the first cube, and the entire $w$ change in the other cube, but what fraction of the changes in $y$ and $z$ get distributed in each cube?  I can see why you want an unfolding mechanism of some sort, to skip the minimizing calculus.
I suspect that you can move along the path with an index $0 \leq t \leq 1.3$, that first moves along the $w=1$ plane until $t = 0.9$, and then along the $x=1$ plane for the remaining $0.9 \leq t \leq 1.3$.  Likewise $y$ will undergo $\frac{9}{13}$ of its change in the first cube, and the remaining $\frac{4}{13}$ in the second, and similarly for $z$.
Examine the unfolding in $3D$ to $2D$ in coordinates.  Say $x=1$ plane is to be rotated up into the $z=1$ plane. Then the coordinates $(1, y, z)$ would get mapped to $(1+z, y, 1)$.  You can do the same pretty much unchanged in four dimensions, I think.  So the points in the $w=1$ boundary cube get moved into the $x = 1$ boundary space, and the point $(1,y,z,w)$ swings up and becomes $(1+w, y, z, 1)$.
