What's the difference between pow and sqrt in this code?
Converting Gerben's comment into an answer:

pow(x, 2) is the second power, in other words:



sqrt(x) is the square root of x, that is:



A whole circle is 360 degrees or 2π when measuring in radians. So this ratio of 180 / 3.141592 is used to convert an angle in radians to an angle in degrees.