Loading…

Distance in 3d Calculator

Math Geometry • Three Dimensional Geometry

View all topics

Distance in 3D Calculator – Between Points in Space (Formula)

Compute the distance between two points \(A(x_1,y_1,z_1)\) and \(B(x_2,y_2,z_2)\) using \(\;d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}\;\). Results include a clean step-by-step breakdown and a 3D visualization you can orbit/zoom.

Inputs accept 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Point coordinates
Point A
Point B
Tip: the squared distance \(d^2\) is often used to avoid square roots in optimization and comparisons.
Display & view

Drag to orbit • Shift + drag to pan • wheel/trackpad to zoom • “Reset view” fits points. Units are square.

Ready
3D view (interactive)

Point A is solid, point B is hollow, and the segment \(AB\) is drawn between them.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is the distance formula in 3D?

The 3D distance between A(x1,y1,z1) and B(x2,y2,z2) is d = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2). It is the length of the displacement vector from A to B.

Why does the 3D distance formula use squares?

Squaring each coordinate difference ensures all contributions are nonnegative and combines perpendicular components using the Pythagorean theorem. This matches how straight-line distance behaves in orthogonal axes.

What is squared distance and when is it useful?

Squared distance is d^2 = (x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2. It is useful for comparing distances without computing a square root, which can be faster in many algorithms.

Does swapping the two points change the distance?

No. Swapping A and B changes the signs of dx, dy, dz but squares remove the sign, so the final distance is the same.