[iOS] Move radians/degrees conversion functions to MGLGeometry.h

This commit is contained in:
Jason Wray
2015-09-04 00:00:28 -04:00
committed by Justin R. Miller
parent 182bd9723e
commit b611c9bb7b
3 changed files with 11 additions and 20 deletions

View File

@@ -3,6 +3,7 @@
#import "MGLTypes.h"
#import <CoreLocation/CoreLocation.h>
#import <CoreGraphics/CGBase.h>
NS_ASSUME_NONNULL_BEGIN
@@ -82,4 +83,14 @@ NS_INLINE NSString *MGLStringFromCoordinateBounds(MGLCoordinateBounds bounds) {
bounds.ne.latitude, bounds.ne.longitude];
}
NS_INLINE CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees)
{
return degrees * M_PI / 180;
}
NS_INLINE CLLocationDegrees MGLDegreesFromRadians(CGFloat radians)
{
return radians * 180 / M_PI;
}
NS_ASSUME_NONNULL_END