Geometry: At what angle from the horizontal is a cube standing on a vertex?

Hi folks, weird question here caused by trying to create a certain effect in a modelling program: how do I rotate a cube so that its vertical axis passes through two opposite vertexes? I’m not asking for help with any specific program, just the angles involved- I suspected 45 degrees wasn’t the correct answer before trying it, but now I’m stalling on even figuring out the correct question to figure out the correct answer. I suspect a deficiency in trigonometry is to blame.

If I’m interpreting your question correctly (and I’m not sure I am), the angle is arccos(1/sqrt(3)), which is approximately 54.7 degrees.

At any rate, if you take a line through the points (0,0,0) and (1,1,1), which runs through opposite vertices of the unit cube, the angle between that line and any one of the three coordinate axes is arccos(1/sqrt(3)). So if you rotate the cube so that that one of its corners is still at the origin but the opposite corner is on the z-axis, that’s the angle you have to rotate through.

Thudlow, thanks. For some reason the angle the program wanted was the complement of 54.7, 35.3, but the cube finally looks like it’s balanced pretty much perfectly. The weird local coordinate system didn’t help but what eventually worked was rotating the cube 45 degrees on the forward-horizontal z axis and -35.3 degrees on the lateral-horizontal x axis.

I still don’t totally understand the math behind this.

Call the side of the cube 1 unit. Take the diagonal of the bottom face of the cube. That has length √2, from Pythagoras, of course.

Now, the “body diagonal” (right the way across the cube from corner to corner) can be thought of as the hypotenuse of a new triangle, with the base as this diagonal line, √2 units, and of height 1 unit (i.e. the side of the cube). Draw a picture if it’s not clear.

So, again by Pythagoras, the length of the body diagonal is √ [(√2)[sup]2[/sup] + 1[sup]2[/sup]], or √3 units.

To find the angle with the base, use sin Θ = opposite/hypotenuse. (Remember soh-cah-toa)

Θ = arcsin (1 /√3) = 35.26º.

Just curious, can I ask which modeling software your using? Mathematica (et al.), or something more akin to Maya/CAD (et al.)?

cmyk, this is actually for a Unity3D development project. I want to have pirouetting cubes as a design element in some places.

Colophon, thank you for going into more detail with that. The soh-cah-toa thing was throwing me off because different people were figuring out the lengths of different sides of the triangle and saying I needed to use different ratios.