distance between two points

How to Calculate the Distance Between Two Points

How is the distance between two geometrical points measured on any surface? What is the most useful formula for that purpose? Read to find all the answers.

One of the most basic problems in mathematics and geometry in particular, is finding the distance that separates points on a graph. In this article, I discuss the calculation of segment length, connecting points on a 2D graph and 3D grid. The case of distance measurement on a sphere, is also discussed. On a Graph The formula for calculating distance on a graph is based on the Pythagoras theorem. To understand that, just draw points on a graph. Let it have a reference frame, in the form of the X and Y axes, intersecting with each other at the origin. Every point will have an X-Coordinate and a Y-coordinate. The X-coordinate is the distance of the point from the Y axis and the Y-coordinate is the distance of the point from the X axis. Now, draw perpendiculars from both points, on both the axes. Then, draw a straight line joining the two points. As you can see, the perpendiculars drawn from the points and the segment joining the points, form a right-angled triangle. The distance is the length of the hypotenuse of the triangle. So, using the Pythagorean theorem formula, you can easily calculate it. Here it is: Distance Separating Points [A(x1, y1), B (x2, y2)] = √[(x2 - x1)2 + (y2 - y1)2] To calculate the distance, you must know the coordinates of the two points. Then, using the above formula, you can easily calculate the distance. Measuring Distance on a 3D Cartesian Grid The above formula can be used, when you are calculating distance on a two-dimensional graph. What if the two points are situated on a three-dimensional grid? To locate a point on this grid, you will have to know three coordinates, instead of two. The formula for calculating this distance is a modification of the Pythagoras theorem formula for three dimensions. Here it is: Distance Between Points [A(x1, y1, z1), B(x2, y2, z2)] = √[(x2 - x1)2 + (y2 - y1)2 + (z2 - z1)2] The knowledge of the three coordinates of both points, will enable you to calculate the distance. Measuring Distance On a Sphere Can the above formulas be used for calculating distances on a sphere? No. That's because a sphere is not a flat surface and Euclidean geometry is not applicable there. It has a 'Curvature', which makes calculation difficult. That is why, a complicated formula is required for calculating this distance. This formula can be used to calculate the great circle distance that separates two places on Earth (assuming the Earth is perfectly spherical, though it is not). The data you need is the knowledge of latitude and longitude of both those points and the radius of the sphere. The formula is as follows: Distance Separating Two Points on a Sphere (D) = R x Δσ where r is the radius of the sphere and Δσ is the central angle subtended by the two points, with the center of the sphere. The points are P (a1, b1) and Q (a2, b2), where a and b are latitude and longitude coordinates. Δσ is calculated by using the following complicated formula (Also known as the Vincenty formula): Δσ = arctan (A/B) where A = √[(cos a1 sin Δb)2 + (cos a2 sin a1 - sin a2 cos a1 cos Δb)2] and B = sin a2 sin a1 + cos a2 cos a1 cos Δb Here, Δb = b1 - b2. I can understand that your head may be spinning after reading this formula but there is no way that you can make it simpler. While using the formula, convert the latitude and longitudes into radians, before substituting values.

Похожие статьи