Flickr4Java
Flickr4Java copied to clipboard
Translate math formula to C++
I need to write a formula to determine the distance between two points in a plane in C++. ### Here is the formula:

I wrote such a code for this, but where is my mistake and how should I write the code correctly?:
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double x1, x2, y1, y2, distance;
distance = sqrt((pow(x2-x1), 2) + pow((y2-y1), 2));
return 0;
}