# Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to pointsDistance.?

The calculation is:

Distance = SquareRootOf( (x2 - x1)2 + (y2 - y1)2 )

You may declare additional variables.

Ex: For points (1.0, 2.0) and (1.0, 5.0), pointsDistance is 3.0.

Distance = SquareRootOf( (x2 - x1)2 + (y2 - y1)2 )

You may declare additional variables.

Ex: For points (1.0, 2.0) and (1.0, 5.0), pointsDistance is 3.0.

Below is the recommendation and reference answer for question "Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to pointsDistance.?" It was collected and sorted by the editor of this site but not sure the answer is entirely accurate.

Good luck with your homework! Thanks for posting it. When you have the solution, please share it if you wish.

#include<cmath> //C++

or

#include<math.h> //C

define these variables x_1, y_1,x_2,y_2;

//Implement the input for C or C++

distance = sqrt(pow(x_2-x_1,2)+pow(y_2-y_1,2));

//show the distance

### Trending

- How to convert an audio (mp3) file to text on a mac. Need just a simple, not fancy or high tech, free way to do this?
- Is it illegal to use a SQL injection to attempt to access your own account on a website?
- So how do I use mysqli_fetch_array with MYSQLI_NUM to echo all records or from an entire column in PHP OOP?
- Programming language question?
- What is my job title?
- What is an interface in Computer Science?
- What is the difference between a freelancer and self-employed?
- Should Apple create a "back door" to the Iphone - Why or Why Not?
- If Java is limited, why do programmers use then? Why not switch over to C++?
- I need help writing a C Program for finding the Radius, Surface Area, Circumference and Volume of a circle (Read Update)?