How to calculate the distance between two points.

` CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)`

{

CGFloat dx = point2.x - point1.x;

CGFloat dy = point2.y - point1.y;

return sqrt(dx*dx + dy*dy );

};

How to calculate the distance between two points.

` CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)`

{

CGFloat dx = point2.x - point1.x;

CGFloat dy = point2.y - point1.y;

return sqrt(dx*dx + dy*dy );

};

This entry was posted in Objective-C and tagged Graphics, Objective-C, Trigonometry. Bookmark the permalink.

You must be logged in to post a comment.

Pingback: Recent URLs tagged Objectivec - Urlrecorder