Im helping in a group project and I just wanted to know if my code is logically correct. The reason I asked is when i compare it to other diameter calculators i get different answers .
here's the code:
return distance ;
}
any help would be appreciated
thanks
btw, snytax wise its correct , and this is only part of the code(just the function I'm having some difficulties with.)
//References changed to straight ints, since there's no need to change their
//values.
double cal_distance(int d_x1,int d_x2,int d_y1,int d_y2)
{
return sqrt(pow(d_x2 - d_x1,2)+pow(d_y2 - d_y1,2));
}
It can made even faster by changing the function to a macro.
Otherwise, it's fine.