I've been going through the documentation but could not seem to find an answer.
How do I use mathematical functions like Rad() and Deg() to convert degrees to radians also the rad to deg?
I've been going through the documentation but could not seem to find an answer.
How do I use mathematical functions like Rad() and Deg() to convert degrees to radians also the rad to deg?
Defining your own functions is trivial, i.e.:
func degToRad(deg : Double) -> Double {
return deg / 180 * M_PI
}
Or put it in an extension.
As an extension to @Eiko's answer, if you're using OpenGL, this answer tells us about this GLKMathDegreesToRadians
function. You can see documentation for this function here.