Answers to: value of pihttps://programabad.com/questions/4874/value-of-pi<p>If we want to calculate area of a circle, We can use the value of pi like this pi = acos(-1.) . How does the inverse function work here and how it gives the value of pi here? Thanks in advance.</p>enMon, 18 Jul 2016 06:55:38 +0000Answer by Najathttps://programabad.com/questions/4874/value-of-pi/4895<p>acos() is just a function which calculates cos^-1(x), where x is an angle.</p>
<p>We have, cos(180) = -1 (the angle is in degree unit)</p>
<p>Now, if we convert the angle from degree to radians, we get,</p>
<p>cos(180* (pi/180)) = -1 (we have, 1 degree = pi/180 radians)</p>
<p>or, cos(pi) = -1</p>
<p>therefore, pi = cos^-1(-1)</p>
<p>which can be expressed in C as: acos(-1)</p>
<p>Note that, acos() is just a built in function in C under the header file math.h just like sin(), cos(), tan() or sqrt(), abs() etc.</p>NajatMon, 18 Jul 2016 06:55:38 +0000https://programabad.com/questions/4874/value-of-pi/4895