Skip to content

Instantly share code, notes, and snippets.

@r3econ
Created February 20, 2014 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r3econ/9124365 to your computer and use it in GitHub Desktop.
Save r3econ/9124365 to your computer and use it in GitHub Desktop.
Distance between two CGPoints.
CGFloat DistanceBetweenTwoPoints(CGPoint pointA, CGPoint pointB)
{
CGFloat dx = pointB.x - pointA.x;
CGFloat dy = pointB.y - pointA.y;
return sqrt(dx*dx + dy*dy);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment