The diagonal of a cube can be calculated using the formula:
D = a√3
where D is the diagonal length and a is the length of one side of the cube.
For a cuboid, the formula for the diagonal is slightly different:
D = √(l² + w² + h²)
In this case, D represents the diagonal length, while l, w, and h are the length, width, and height of the cuboid, respectively.
To explain further, in a cube, all sides are equal, hence the simple multiplication by the square root of three applies. In contrast, a cuboid has three distinct dimensions, necessitating the addition of the squares of each dimension to accurately calculate the diagonal.