Skip to content

Instantly share code, notes, and snippets.

@maddiesch
Created March 13, 2015 17:26
Show Gist options
  • Save maddiesch/c8801868aef7ab16fea4 to your computer and use it in GitHub Desktop.
Save maddiesch/c8801868aef7ab16fea4 to your computer and use it in GitHub Desktop.
Get distance between two points
UIKIT_EXTERN CGFloat SKYDistanceFromPointToPoint(CGPoint, CGPoint);
CGFloat SKYDistanceFromPointToPoint(CGPoint one, CGPoint two) {
return sqrt(pow((two.x - one.x), 2.0) + pow((two.y - one.y), 2.0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment