     return meters / meterToDegreesRatio
 }
 
+func radiansToDegrees(radians: Double) -> Double {
+    return radians * 180.0 / M_PI;
+}
+
+extension CLLocationDirection {
+    func isValid() -> Bool {
+        return self > 0.0
+    }
+}
+
 extension MKRouteStep {
     var distanceMiles:Double {
         return metersToMiles(distance)

    }

    ///meters per pixel for current viewport
    func metersPerPixel() -> Double {
        return MKMetersPerMapPointAtLatitude(centerCoordinate.latitude) * visibleMapRect.size.width / Double(bounds.size.width)
    }
}


extension MKMapView {
    ///The maximum length in meters of current viewport
    func maxDimensionMeters() -> CLLocationDistance {
        let topLeft:MKMapPoint = visibleMapRect.origin
        let topRight:MKMapPoint = MKMapPoint(x: visibleMapRect.origin.x + visibleMapRect.size.width,
                                             y: visibleMapRect.origin.y)
