diff options
author | Jason Wray <jason@kulturny.com> | 2015-09-04 00:00:28 -0400 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2015-09-11 11:36:32 -0700 |
commit | c34d62aca29f207bbd68b48ee13063c9e4fed82a (patch) | |
tree | 84840d5c80b372ffc0aecdc45f8f1d3aeb04da72 /include | |
parent | c8e80595d854c79f4c16ef4237f7a4ca9d18ddd9 (diff) | |
download | qtlocation-mapboxgl-c34d62aca29f207bbd68b48ee13063c9e4fed82a.tar.gz |
[iOS] Move radians/degrees conversion functions to MGLGeometry.h
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/ios/MGLGeometry.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLGeometry.h b/include/mbgl/ios/MGLGeometry.h index 6226af1d08..2dee7c76cd 100644 --- a/include/mbgl/ios/MGLGeometry.h +++ b/include/mbgl/ios/MGLGeometry.h @@ -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 |