I am able to find the x,y location on the iPhone screen using a method similar to: How to get a CGPoint from a tapped location?. However, since TouchesBegan and TouchesEnded require void, I am unable to return there locations directly and use in a different method to calculate the distance. The distance method I am trying to use is:
- (CGFloat) calculateDistanceBetweenPoint1: (CGPoint)start point2:(CGPoint)end
{
CGFloat dx = end.x - start.x;
CGFloat dy = end.y - start.y;
return sqrt(dx*dx + dy*dy);
}
where end is the coordinate using touchesEnded and start is the coordinate using touchesBegan. Once I find the distance in pixels I will then convert it to inches or centimeters. Any suggestions?