Created
February 20, 2014 22:11
-
-
Save r3econ/9124365 to your computer and use it in GitHub Desktop.
Distance between two CGPoints.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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