Calculate Distance Between Two Points in Objective-C
Monday, June 30th, 2008How 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 );
};
Tags: Graphics, Objective-C, Trigonometry


November 9th, 2008 at 8:16 am
[...] Recent public urls tagged “objectivec” → Calculate Distance Between Two Points in Objective-C [...]
January 1st, 2009 at 10:00 pm
hi…
You need more rest i think…