# Math Help - distance between 2 points in 3D space

1. ## distance between 2 points in 3D space

Hello,

I'm programming a tool and I need to know how to calculate the distance between two points in 3D space?

Please if possible explain it the way appropriate for programming.
Assuming that your points are given in (x, y, z) form, then if the two points are $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$, the distance between the points is SQUAREROOT( $(x_1-x_2)^2+ (y_1-y_2)^2+ (z_1-z_2)^2$). It's that easy!