cocoaTouch/otherSrc/CGPointUtils.c
changeset 3385 361bd29293f4
parent 2725 89908847b155
equal deleted inserted replaced
3384:7eb4707d43f0 3385:361bd29293f4
     8  */
     8  */
     9 
     9 
    10 #include "CGPointUtils.h"
    10 #include "CGPointUtils.h"
    11 #include <math.h>
    11 #include <math.h>
    12 
    12 
    13 #define degreesToRadian(x) (M_PI * x / 180.0)
       
    14 #define radiansToDegrees(x) (180.0 * x / M_PI)
       
    15 
    13 
    16 CGFloat distanceBetweenPoints (CGPoint first, CGPoint second) {
    14 CGFloat distanceBetweenPoints (CGPoint first, CGPoint second) {
    17 	CGFloat deltaX = second.x - first.x;
    15 	CGFloat deltaX = second.x - first.x;
    18 	CGFloat deltaY = second.y - first.y;
    16 	CGFloat deltaY = second.y - first.y;
    19 	return sqrt(deltaX*deltaX + deltaY*deltaY );
    17 	return sqrt(deltaX*deltaX + deltaY*deltaY );