Logo Search packages:      
Sourcecode: race version File versions

float CAImageManipulation::getDistance ( float  x1,
float  y1,
float  x2,
float  y2 
) [static]

Returns the distance from one point to an other.

Definition at line 490 of file caimagemanipulation.cpp.

Referenced by getExactColor().

{
  float xd2 = (x2-x1)*(x2-x1);
  float yd2 = (y2-y1)*(y2-y1);
  float d   = xd2+yd2;
  if(d<0.0) d*=-1.0;
  return(sqrt(d));
}


Generated by  Doxygen 1.6.0   Back to index