Very mandatory self-explained function.
/** Convert from degrees to radians.
@param deg Degrees value.
@return Returns the radians value.
@see radiansToDegrees:
*/
CGFloat degreesToRadians (CGFloat deg) {
return deg * (M_PI / 180.0f);
}
Download the ready-for-use source file (.m) of http://adf.ly/QQEIQ
A useful and helpful collection library of common Objective-C functions, methods, classes and categories.
Showing posts with label degrees. Show all posts
Showing posts with label degrees. Show all posts
July 9, 2013
July 8, 2013
Radians to Degrees conversion
A must to have function that converts radians into degrees.
/** Convert from radians to degrees.
@param rad Radians value.
@return Returns the degrees value.
@see degreesToRadians:
*/
CGFloat radiansToDegrees (CGFloat rad) {
return rad * (180.0f / M_PI);
}
Download the ready-for-use source file (.m) of Radians to Degrees conversion
/** Convert from radians to degrees.
@param rad Radians value.
@return Returns the degrees value.
@see degreesToRadians:
*/
CGFloat radiansToDegrees (CGFloat rad) {
return rad * (180.0f / M_PI);
}
Download the ready-for-use source file (.m) of Radians to Degrees conversion
Subscribe to:
Posts (Atom)