Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

3D Distance Calculator (Distance Between Two Points in Space from xyz Coordinates)

Enter the xyz coordinates of point 1 and point 2 to find the distance between them in 3D space. The changes in x, y and z are shown too.

Enter the coordinates as numbers (decimals and negative numbers are OK). All six fields are required.
Result and figure
Enter the xyz coordinates of two points in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Enter the xyz coordinates of two points in space (3D), and you get the distance \(d\) between them on the spot
  • Along with the distance, it also finds the change in x \(\Delta x\), the change in y \(\Delta y\) and the change in z \(\Delta z\)
  • The result is also shown in a 3D figure you can rotate with the mouse, so you can see that the distance is the length of the line segment joining the two points (the diagonal of a box)
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This page finds the straight-line distance between two points in space (three dimensions). For the distance in the plane, with only two coordinates (x, y), use the related "Distance Between Two Points Calculator". In 3D, a line has no single "slope" and no equation of the form y = mx + b, so this page shows only the distance and the changes in the coordinates.

What is this calculation used for?

Collision and distance checks in 3D games and VR (programming)

In a 3D game, the positions of characters, bullets and items are kept as (x, y, z) coordinates, and the game decides "it is a hit when the distance is less than a set amount" or "an enemy notices you when you come within a set distance". For example, if your character is at (1, 1, 1) and an enemy is at (2, 3, 3), the distance is \(\sqrt{1^2 + 2^2 + 2^2} = 3\). Repeating this calculation every frame is how distance checks in 3D games work.
It is just the distance formula from 2D games with one more term for \(z\).

Straight-line distance to a drone (surveying and aerial photography)

A drone's position can be given by three numbers: how far away it is horizontally (x and y) and its height (z). If a drone is 240 ft east and 320 ft north of the pilot, at a height of 300 ft, the straight-line distance to it is \(\sqrt{240^2 + 320^2 + 300^2} = \sqrt{250000} = 500\) ft.
This distance in space is what you use to think about radio range and how far away you can still see the drone.

Measuring diagonal lengths in 3D CAD and 3D printing (design and manufacturing)

In 3D CAD, positions such as the centers of holes and the corners of a part are given as coordinates in space. The distance between two points that are diagonally apart in space, which is often not written on the drawing, can be found from the differences in coordinates with the formula on this page. For example, two points 3 in apart across, 4 in apart in depth and 12 in apart vertically are \(\sqrt{3^2 + 4^2 + 12^2} = 13\) in apart.
It is an everyday calculation in making things, such as estimating the length of a brace or the shortest route for pipes and wires.

Finding the distance between atoms in a molecule (chemistry and drug discovery)

In chemistry, the position of each atom in a molecule is recorded as coordinates in space (protein databases use this format too). Once you know the coordinates of two atoms, the distance between them (a bond length, or how close two atoms are) is found with exactly the formula on this page.
It is a basic calculation behind drug discovery and materials development, for example when checking whether a candidate drug molecule fits well into its target.

Formulas and figures

Distance \(d\) between two points in 3D space (the 3D distance formula)
Figure
Standard notation (the usual math form)
\(d\) \(=\) \(\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}\)
In words (symbols replaced with words)
② \(d\): distance between the points \(=\) ① square root of the sum of the squared differences
The formula in words
① Take the square root of the sum of the squared differences, \((x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2\) (square the differences of the x-, y- and z-coordinates, add them all, and take the square root)
② and you get the \(d\): distance between the points
Quick example
The distance between the points (1, 1, 1) and (2, 3, 3) is
distance \(d\) \(=\) square root of the sum of the squared differences ((2−1)² + (3−1)² + (3−1)² = 9)
\(d = \sqrt{(2-1)^2 + (3-1)^2 + (3-1)^2} = \sqrt{1 + 4 + 4} = \sqrt{9} = 3\)
Key idea
It is the distance formula for the plane (2D) with just one more term, \((z_2 - z_1)^2\), and the steps are exactly the same: square the differences, add them all, and take the square root only once, at the end. A common mistake is to take the square roots separately, as in \(\sqrt{(x_2-x_1)^2} + \sqrt{(y_2-y_1)^2} + \sqrt{(z_2-z_1)^2}\). Also, even if a difference of coordinates is negative, its square is positive, so the distance is the same whichever point you enter first. The answer is often a number that does not come out even, such as \(\sqrt{3}\); in that case, this calculator shows a decimal (an approximate value).
Why this formula gives the distance (using the Pythagorean theorem twice)
Figure
Standard notation (the usual math form)
\(\Delta x^2\) \(+\) \(\Delta y^2\) \(+\) \(\Delta z^2\) \(=\) \(d^2\)
In words (symbols replaced with words)
① square of the change in x, \(\Delta x\) \(+\) ② square of the change in y, \(\Delta y\) \(+\) ③ square of the change in z, \(\Delta z\) \(=\) ④ square of the distance \(d\)
The formula in words
① Add the square of the change in x, \(\Delta x\) (how far apart the points are left to right)
② the square of the change in y, \(\Delta y\) (how far apart they are front to back)
③ and the square of the change in z, \(\Delta z\) (how far apart they are up and down)
④ and you get exactly the square of the distance \(d\) between the points (the diagonal of the box) (the 3D version of the Pythagorean theorem)
Quick example
Checking with the points (0, 0, 0) and (3, 4, 12) (Δx = 3, Δy = 4, Δz = 12)
Δx squared (3² = 9) \(+\) Δy squared (4² = 16) \(+\) Δz squared (12² = 144) \(=\) distance squared (169 = 13²)
\(\ell = \sqrt{3^2 + 4^2} = \sqrt{25} = 5\)
\(d = \sqrt{\ell^2 + 12^2} = \sqrt{25 + 144} = \sqrt{169} = 13\)
Key idea
Picture a rectangular box with the two points at opposite corners. First, look only at the floor: by the Pythagorean theorem in the plane, the floor diagonal \(\ell\) satisfies \(\ell^2 = \Delta x^2 + \Delta y^2\). Next, use the Pythagorean theorem once more, on the right triangle formed by this floor diagonal \(\ell\) and the height \(\Delta z\). This gives \(d^2 = \ell^2 + \Delta z^2 = \Delta x^2 + \Delta y^2 + \Delta z^2\). So the 3D distance formula is "the Pythagorean theorem used twice", and the distance between the two points is exactly the length of the box's diagonal. Once you see that it is the same calculation as the "diagonal of a box" problem from Grade 8, you have one less thing to memorize.
To find the distance between two points in 3D space, square the differences of the x-, y- and z-coordinates, add them all, and take the square root. This is the Pythagorean theorem used twice, the same as finding the diagonal of a box. Picture it as the plane distance formula with one more term, \(\Delta z^2\), and you will not forget it.

Symbols and terms

Symbols

\(d\) dee The distance between the two points in space, from the first letter of "distance".
\((x_1, y_1, z_1)\), \((x_2, y_2, z_2)\) x sub one, y sub one, z sub one The coordinates of the two points in space. \(x\) and \(y\) give the position on a flat plane, and \(z\) gives the height. The small number at the lower right (the subscript) tells the first point from the second.
\(\Delta x\), \(\Delta y\), \(\Delta z\) delta x, delta y, delta z The change (the difference of the coordinates). \(\Delta\) (delta) is a Greek letter that stands for "change" or "difference": \(\Delta x = x_2 - x_1\), \(\Delta y = y_2 - y_1\) and \(\Delta z = z_2 - z_1\).
\(\ell\) ell The symbol used in this explanation for the length of the floor diagonal of the box. \(\ell^2 = \Delta x^2 + \Delta y^2\); it is the in-between step when using the Pythagorean theorem twice.
\(\sqrt{\phantom{a}}\) square root (radical sign) The sign for the square root (the number that gives this number when squared). \(\sqrt{9} = 3\) (because 3² = 9). In the 3D distance formula, too, you take the square root only once, at the end.

Terms

3D coordinate space Space with a z-axis for height added to the x-axis and the y-axis, where the position of a point is given by three numbers (x, y, z). It is plane (2D) coordinates with one more coordinate for height.
coordinates Numbers that give the position of a point. In space there are three, as in the point (2, 3, 3): 2 in the x-direction, 3 in the y-direction and 3 in the z-direction (height).
line segment A straight line that joins two points, with those points as its ends. The distance between two points is the length of this line segment.
Pythagorean theorem The theorem that in a right triangle, the sum of the squares of the two legs equals the square of the hypotenuse. The 3D distance formula uses this theorem twice in a row. It is taught in Grade 8.
diagonal of a box The line that joins opposite corners of a rectangular box (rectangular prism), passing through the inside. For a box with length a, width b and height c, the diagonal is \(\sqrt{a^2 + b^2 + c^2}\) long. The distance between two points in space is the same calculation.
Euclidean distance The formal name for the straight-line distance between two points that this page calculates. Not only in 3D but also in data analysis and AI, this name is often used for the basic way to measure how close points are.
dimension How many numbers you need to give a position. A line is 1-dimensional (the number line), a plane is 2-dimensional (x, y), and space is 3-dimensional (x, y, z). Each extra dimension adds just one more term under the square root; the shape of the distance formula stays the same.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the fastest way forward.

The coordinate plane (Grade 6)
  • Being able to read coordinates such as (4, 5) as a pair made of a horizontal position and a vertical position
  • Knowing that negative x- and y-coordinates stand for positions in the opposite direction
Operations with positive and negative numbers (Grade 7)
  • Being able to subtract with negative numbers, as in \(3 - (-3) = 6\)
  • Knowing that the square of a negative number is positive
Square roots (Grade 8)
  • Knowing that a square root is the number that gives the original number when squared, as in \(\sqrt{9} = 3\)
  • Knowing that a square root that does not come out even, such as \(\sqrt{3}\), can be written as an approximate decimal
The Pythagorean theorem (Grade 8)
  • Knowing that in a right triangle, the sum of the squares of the two legs equals the square of the hypotenuse
  • Being able to find the length of the diagonal of a box by using the Pythagorean theorem twice (this is what the 3D distance formula really is)
Solid figures and 3D coordinates (middle school and high school)
  • Being able to picture how the corners, edges and faces of a box are arranged
  • Knowing that a point in space can be given by three numbers \((x, y, z)\) (this is covered in detail in high school, but the calculation on this page needs only middle school math)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the distance d between two points in 3D
Point 1 x-coordinate x₁ 1
Point 1 y-coordinate y₁ 1
Point 1 z-coordinate z₁ 1
Point 2 x-coordinate x₂ 2
Point 2 y-coordinate y₂ 3
Point 2 z-coordinate z₂ 3
Distance between the points d =SQRT((B4-B1)^2+(B5-B2)^2+(B6-B3)^2)
Table to check with the Pythagorean theorem twice
Point 1 x-coordinate x₁ 0
Point 1 y-coordinate y₁ 0
Point 1 z-coordinate z₁ 0
Point 2 x-coordinate x₂ 3
Point 2 y-coordinate y₂ 4
Point 2 z-coordinate z₂ 12
Change in x Δx =B4-B1
Change in y Δy =B5-B2
Change in z Δz =B6-B3
Floor diagonal ℓ=√(Δx²+Δy²) =SQRT(B7^2+B8^2)
Distance between the points d=√(ℓ²+Δz²) =SQRT(B10^2+B9^2)
After pasting, the upper rows are your inputs, and the formulas in the lower rows are calculated automatically.
"SQRT(…)" is the square root, and "^2" is squared.
The first table gives the distance 3. The second table starts from Δx = 3, Δy = 4 and Δz = 12, finds the floor diagonal ℓ = 5 first and then the distance d = 13, so you can also see the values along the way when the Pythagorean theorem is used twice.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the distance d between two points in 3D
Point 1 x-coordinate x₁ 1
Point 1 y-coordinate y₁ 1
Point 1 z-coordinate z₁ 1
Point 2 x-coordinate x₂ 2
Point 2 y-coordinate y₂ 3
Point 2 z-coordinate z₂ 3
Distance between the points d =SQRT((B4-B1)^2+(B5-B2)^2+(B6-B3)^2)
Table to check with the Pythagorean theorem twice
Point 1 x-coordinate x₁ 0
Point 1 y-coordinate y₁ 0
Point 1 z-coordinate z₁ 0
Point 2 x-coordinate x₂ 3
Point 2 y-coordinate y₂ 4
Point 2 z-coordinate z₂ 12
Change in x Δx =B4-B1
Change in y Δy =B5-B2
Change in z Δz =B6-B3
Floor diagonal ℓ=√(Δx²+Δy²) =SQRT(B7^2+B8^2)
Distance between the points d=√(ℓ²+Δz²) =SQRT(B10^2+B9^2)
The same formulas as in Excel (SQRT and ^2) work as is in Google Sheets. Copy the whole table, paste it into cell A1, and replace the input numbers with your own coordinates.

How to calculate it in Python

import math

x1, y1, z1 = 1.0, 1.0, 1.0   # coordinates of point 1
x2, y2, z2 = 2.0, 3.0, 3.0   # coordinates of point 2

delta_x = x2 - x1   # change in x
delta_y = y2 - y1   # change in y
delta_z = z2 - z1   # change in z
distance = math.sqrt(delta_x**2 + delta_y**2 + delta_z**2)  # distance between the points

print(f"Change in x Δx: {delta_x}")
print(f"Change in y Δy: {delta_y}")
print(f"Change in z Δz: {delta_z}")
print(f"Distance between the points d: {distance}")

# The same calculation can be written in one line with math.dist (Python 3.8 or later)
print(f"Check with math.dist: {math.dist((x1, y1, z1), (x2, y2, z2))}")
Runs with the standard library only. math.sqrt is the square root, and "**2" is squared. The last line, math.dist, is a function that finds the distance from the coordinates of two points in one step, so you can also check that the answers match. Change the coordinates at the top and run it.

How to write it in LaTeX and other math languages (copy and paste)

Distance \(d\) between two points in 3D space (the 3D distance formula)
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>d</mi>
    <mo>=</mo>
    <msqrt>
      <mrow>
        <msup>
          <mrow><mo>(</mo><msub><mi>x</mi><mn>2</mn></msub><mo>&#x2212;</mo><msub><mi>x</mi><mn>1</mn></msub><mo>)</mo></mrow>
          <mn>2</mn>
        </msup>
        <mo>+</mo>
        <msup>
          <mrow><mo>(</mo><msub><mi>y</mi><mn>2</mn></msub><mo>&#x2212;</mo><msub><mi>y</mi><mn>1</mn></msub><mo>)</mo></mrow>
          <mn>2</mn>
        </msup>
        <mo>+</mo>
        <msup>
          <mrow><mo>(</mo><msub><mi>z</mi><mn>2</mn></msub><mo>&#x2212;</mo><msub><mi>z</mi><mn>1</mn></msub><mo>)</mo></mrow>
          <mn>2</mn>
        </msup>
      </mrow>
    </msqrt>
  </mrow>
</math>
d = sqrt((x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2)
Sqrt[(x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2]
d := sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2);
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2);
d = √((x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2)
Why this formula gives the distance (using the Pythagorean theorem twice)
Δx² + Δy² + Δz² = d²
\Delta x^2 + \Delta y^2 + \Delta z^2 = d^2
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msup><mrow><mi mathvariant="normal">&#x394;</mi><mi>x</mi></mrow><mn>2</mn></msup>
    <mo>+</mo>
    <msup><mrow><mi mathvariant="normal">&#x394;</mi><mi>y</mi></mrow><mn>2</mn></msup>
    <mo>+</mo>
    <msup><mrow><mi mathvariant="normal">&#x394;</mi><mi>z</mi></mrow><mn>2</mn></msup>
    <mo>=</mo>
    <msup><mi>d</mi><mn>2</mn></msup>
  </mrow>
</math>
(Delta x)^2 + (Delta y)^2 + (Delta z)^2 = d^2
dx^2 + dy^2 + dz^2 == d^2
dx^2 + dy^2 + dz^2 = d^2;
dx^2 + dy^2 + dz^2 == d^2
Δx^2 + Δy^2 + Δz^2 = d^2

How to have ChatGPT  do the calculation

You are a math calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

For the two points (1, 1, 1) and (2, 3, 3) in 3D space (coordinate space), find each of the following:
1. The distance d between the two points (use the 3D distance formula d = √((x2−x1)² + (y2−y1)² + (z2−z1)²))
2. The change in x Δx, the change in y Δy and the change in z Δz

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.