 
 }
 
-
-func distanceFrom(p1:CGPoint, to p2:CGPoint) -> CGFloat
+public func distanceFrom(p1:CGPoint, to p2:CGPoint) -> CGFloat
 {
     return sqrt(pow((p2.x - p1.x), 2) + pow((p2.y - p1.y), 2))
 }
 
-func midPoint(between p1:CGPoint, and p2:CGPoint) -> CGPoint
+public func midPoint(between p1:CGPoint, and p2:CGPoint) -> CGPoint
 {
     return CGPoint((p1.x + p2.x) / 2.0, (p1.y + p2.y) / 2.0)
 }


extension CGPoint: Equatable
{
    func isEqualTo(point: CGPoint, withPrecision precision:CGFloat) -> Bool
    {
        return  distanceTo(point) < abs(precision)
    }

    public func distanceTo(point: CGPoint) -> CGFloat
    {
        return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2))
    }
    

    // MARK: distance

    public func midWayTo(p2:CGPoint) -> CGPoint
    {
        return CGPoint((self.x + p2.x) / 2.0, (self.y + p2.y) / 2.0)
    }
    
    // MARK: rotation
