Cube diagonal secret
The longest straight line inside a cube is its body diagonal: edge length × √3. That’s just the 3D distance formula wrapped in a box.
Tips: Use scientific notation (e.g., 1e-3). Press Ctrl/Cmd + Enter to calculate.
The 3D distance formula is the natural extension of the Pythagorean theorem into three dimensions. In two dimensions, the straight-line (Euclidean) distance between two points is found by squaring the horizontal and vertical differences, adding them, and taking the square root. In 3D, we simply include the depth difference as a third squared term.
Consider two points: P₁ = (x₁, y₁, z₁) and P₂ = (x₂, y₂, z₂). The component
differences are (x₂ − x₁), (y₂ − y₁), and (z₂ − z₁). The
Euclidean distance D between these points is:
D = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²).
This formula accepts any real numbers, including negatives and decimals, and is widely used in computer graphics and game development (to measure object separation), physics and engineering (to compute magnitudes of displacement), robotics and path planning (to evaluate shortest paths), GIS and mapping (to estimate straight-line distances), and general spatial analytics.
The tool runs entirely in your browser using JavaScript—no data leaves your device. After you enter
x₁, y₁, z₁, x₂, y₂, and z₂
and click “Calculate Distance,” it:
dx = x₂ − x₁, dy = y₂ − y₁, and dz = z₂ − z₁.dx² + dy² + dz².Results are instantaneous and private, making this calculator ideal for quick checks, coursework, and engineering sketches without leaving traces online.
Computer graphics and games, physics/engineering (displacement), robotics/path planning, and GIS/mapping.
The longest straight line inside a cube is its body diagonal: edge length × √3. That’s just the 3D distance formula wrapped in a box.
Add more coordinates, add more squared differences. The 3D formula is the same pattern behind N‑dimensional Euclidean distance.
Translate or rotate everything in space—distances stay identical. That invariance powers physics engines and CAD constraints.
Collision check shortcut: two spheres intersect if center distance < sum of radii. One distance compare beats heavy mesh math.
Euclidean distance assumes flat space. Over Earth you need great‑circle math, but once you’re off-planet, 3D straight‑line distance rules again.