; This input to Mathomatic arrives at the distance between two points ; in 3D space from the Pythagorean theorem (distance between two points ; in 2D space). l^2=(x1-x2)^2+(y1-y2)^2 ; Distance formula for 2D space. d^2=l^2+(z1-z2)^2 ; Add another leg. eliminate l ; Combine the two equations. d ; Solve to get the distance formula for 3D space. ; The coordinate of point 1 is (x1, y1, z1) and point 2 is (x2, y2, z2).