Tag Archives: CGFloat

(Objective C) How to find the distance between two CG points

Distance depakote online no rx. between p1 and p2: CGFloat xDist = (p2.x – p1.x); CGFloat yDist = (p2.y – p1.y); CGFloat distance = sqrt((xDist * xDist) + (yDist * yDist)); Background: Pythagorean theorem Edit: if you only need to calculate if the distance between the points increases or decreases, you can omit the sqrt() [...]

Posted in Objective-C | Also tagged , , , , | Leave a comment