<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/objective-c/tags/CGPoint</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sat, 25 May 2013 11:38:48 GMT</pubDate>
<item>
<title>(Objective C) How to find the distance between two CG points? - espinallab</title>
<link>http://snipplr.com/view/54359/how-to-find-the-distance-between-two-cg-points/</link>
<description><![CDATA[ <p>Distance 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() which will make it a little faster.</p> ]]></description>
<pubDate>Wed, 25 May 2011 08:18:31 GMT</pubDate>
<guid>http://snipplr.com/view/54359/how-to-find-the-distance-between-two-cg-points/</guid>
</item>
</channel>
</rss>