Simple distance corner to corner

enduser

New member
Joined
Dec 11, 2011
Messages
1
Hello all, first time poster.

I am apart of another forum that has challenges. Mostly for web security, but the have programming challenges too which are the ones I like.

Anyway, one of the programming challenges is as fallows:
Given the the figure above is indeed a cube (that is, length, width, and height are all equivalent), and also that the cube is a solid object (that is, you can not go through the cube to get from point 0 to point 1), you must find the shortest distance from point 0 to point 1, moving around the cube.
Example, side length -> 3, answers is 6.

Values given (Length/Height/Width) 4090.6

Figure:

cube-prime.gif

I am not really a math person, more algebra then geometry. I've googled and tried various formulas like:
A) (sqrt(2)*sideLenght)+sideLenght

B) sideLen^2+sideLen^2=c^2
__sideLen^2+c^2 = finalAnswer^2

C) sideLen*root(3)

None of these have worked, even with the proper rounding. I think the formulas I've tried are going through the cube instead of around.
I feel kinda dumb not knowing this, since i did take Geom in highschool, and it's been puzzling me.

Any suggestions?
 
There is some strange stuff going on in there. Your minimum path should be from (0) to the midpoint of an opposite side in the same plane, followed by the next (and relatively obvious) path to (1). side = 3 does NOT lead to a solution of 6.

A couple tries at the Pythagorean Theorem should expose it.
 
Top