- - (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent *)event
- {
- CGPoint pt;
- float HALFSIDE = SIDELENGTH / 2.0f;
- // normalize with centered origin
- pt.x = (point.x - HALFSIDE) / HALFSIDE;
- pt.y = (point.y - HALFSIDE) / HALFSIDE;
- // x^2 + y^2 = radius
- float xsquared = pt.x * pt.x;
- float ysquared = pt.y * pt.y;
- // If the radius < 1, the point is within the clipped circle
- if ((xsquared + ysquared) < 1.0) return YES;
- return NO;
- }
id 博主 = [[KILONET.CNBLOGS.COM alloc] initWithValue:@"天堂向右,我依然向左"
网名:@"老舟"
兴趣:@"影音,阅读"
动态:@"系统架构设计,Android通信模块开发"
网址:@"http://kilonet.cnblogs.com"
签名:@"--------------------------------------------------
Stay Hungry , Stay Foolish
求 知 若 渴,处 事 若 愚
--------------------------------------------------"
]; // Never Release