Open imzyf opened 6 years ago
https://stackoverflow.com/questions/1906511/how-to-find-the-distance-between-two-cg-points
CGFloat distance = hypotf(p1.x - p2.x, p1.y - p2.y);
extension CGPoint { func distance(toPoint p:CGPoint) -> CGFloat { return sqrt(pow(x - p.x, 2) + pow(y - p.y, 2)) } }
https://stackoverflow.com/questions/1906511/how-to-find-the-distance-between-two-cg-points