Skip to content

Commit

Permalink
[Math] Add degrees to radians method to MDCMath (#2015)
Browse files Browse the repository at this point in the history
* Adding radian/degree math

* Cast to float
  • Loading branch information
Junius Gunaratne committed Sep 21, 2017
1 parent ff1e93f commit d200d6c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/private/Math/src/MDCMath.h
Expand Up @@ -30,6 +30,14 @@ static inline CGFloat MDCFabs(CGFloat value) {
#endif
}

static inline CGFloat MDCDegreesToRadians(CGFloat degrees) {
#if CGFLOAT_IS_DOUBLE
return degrees * (CGFloat)M_PI / 180.0;
#else
return degrees * (CGFloat)M_PI / 180.f;
#endif
}

static inline bool MDCCGFloatEqual(CGFloat a, CGFloat b) {
const CGFloat constantK = 3;
#if CGFLOAT_IS_DOUBLE
Expand Down

0 comments on commit d200d6c

Please sign in to comment.