# 2D distance calculator

We have these answers and more, including an in-depth explanation of the way to calculate the space between any two objects in 2D space.

#### Input

$$X_1=-7, Y_1=-4$$ $$X_2=17, Y_2=6.5$$

#### Solution

$$d =\sqrt{(17-(-17))^2+(6.5-(-4))^2}.$$ $$d = \sqrt {(24)^2 + (10.5)^2}.$$ squaring both terms we get, $$d = \sqrt {576 + 110.25}.$$ adding the 2 results, $$d = \sqrt 686.25.$$ finally, $$d = 26.196374.$$

#### Formula :

$$Distance =\sqrt{(x2-x1)^2+(y2-y1)^2}.$$

#### Distance Equation Solution:

To calculate the distance between 2 points, (X1, Y1) and (X2, Y2), for example, (-7, -4) and (17,6.5), we plug our values into the distance formula: combining terms inside parentheses we get:

# About the 2D distance calculator

Have you ever wanted to calculate the space from one point to a different or space between cities? Have you ever wondered what the space definition is? We have these answers and more, including an in-depth explanation of the way to calculate the space between any two objects in 2D space. As a bonus, we have a desirable topic on how we perceive distances (for example as a percentage difference); we're sure you'll love it!

## What is the distance?

The foremost common meaning is that the /1D space between two points. You’ll see within the following sections how the concept of distance are often extended beyond length, in additional than one sense that's the breakthrough behind Einstein's theory of relativity.

If we persist with the geometrical definition of distance we still need to define what quiet space we are working in. In most cases, you're probably talking about three dimensions or less, since that's all we will imagine without our brains exploding. For this calculator, we focus only on the 2D distance (with the 1D included as a special case). If you're trying to find the 3D distance between 2 points we encourage you to use our 3D distance calculator made specifically for that purpose.

To find the space between two points, the primary thing you would like is two points, obviously. These points are described by their coordinates in space. for every point in 2D space, we'd like two coordinates that are unique thereto point. If you would like to seek out the space between two points in 1D space you'll still use this calculator by simply setting one among the coordinates to be an equivalent for both points. Since this is often a really special case, from now on we'll talk only about distance in two dimensions.

The next step, if you would like to be mathematical, accurate, and precise, is to define the sort of space you're working in. No, wait, don't run away! It’s easier than you think that. If you do not know what space you're working in or if you didn't even know there's quite one sort of space, you're presumably working in Euclidean space. Since this is often the "default" space during which we do almost every geometrical operation and it is the one we've set for the calculator to work on. Let's dive a touch deeper into Euclidean space, what's it, what properties does it have and why is it so important?

### The distance formula for Euclidean distance

The Euclidean space or elementary geometry is what we all usually consider 2D space is before we receive any deep mathematical training in any of those aspects. In Euclidean space, the sum of the angles of a triangle equals 180º and squares have all their angles adequate to 90º; always. This is often something we all deem granted, but this is often not true altogether spaces. Let's also not confuse Euclidean space with multidimensional spaces. Euclidean space can have as many dimensions as you would like, as long as there are a finite number of them, and that they still obey Euclidean rules.

The first example we present to you may be a bit obscure, but we hope you'll excuse us, as we're physicists, for starting with this vital sort of space: Minkowski space. The rationale we've selected this is often because it's extremely common in physics, especially it's utilized in relativity, general theory of relativity, and even in relativistic quantum theory. This space is extremely almost like Euclidean space, but differs from it during a very crucial feature: the addition of the scalar product also called the scalar product (not to be confused with the cross product).

Both the Euclidean and Minkowski space are what mathematicians call flat space. This suggests that space itself has flat properties; for instance, the shortest distance between any two points is usually a line between them (check the linear interpolation calculator). There are, however, other sorts of mathematical spaces called curved spaces during which space is intrinsically curved and therefore the shortest distance between two points is not any line.

Distance to a line and between 2 lines

Let's check out a couple of examples in 2D space. To calculate the space between some extent and a line we could go step by step (calculate the segment perpendicular to the road from the road to the purpose and therefore compute its length) or we could simply use this 'handy-dandy' equation: d = |Ax1 + By1 + C | / √ (A2 + B2) where the road is given by Ax+By+C = 0 and the point is defined by (x1, y1).

The only problem here is that a line is usually given as y = mx + b so we might get to convert this equation to the previously show form: y = mx + b → mx - y + b = 0 so we will see that A = m, B = -1 and C = b. This leaves the previous equation with the subsequent values: d = |mx1 -y1 + b | / √ (m2 + 1).

For the space between 2 lines, we just got to compute the length of the segment that goes from one to the opposite and is perpendicular to both. Once more, there's an easy formula to assist us: d= |C2-C1|/√ (A2+B2) if the lines are A1 x+B1 y+C1 = 0 and A2x+B2y+C2 = 0. We will also convert to slope-intercept form and obtain: d= |b2-b1|/√ (m2+1) for lines y = m1x + b1 and y = m2x + b2.

Notice that both lines must be parallel since otherwise they would touch at some point and their distance would then be d = 0. That is the reason the formulas omit most of the subscripts since for parallel lines: A1 = A2 = A and B1 = B2 = B while in slope-intercept form parallel lines are those that m1 = m2 = m

A.