Converting Complex-Valued Angles from Radians to Degrees in Python?
<p>After using cmath to compute the asin of 1.47, which returns a complex angle measured in radians;</p>

<blockquote>
  <p>cmath.asin(1.47)</p>
  
  <p>(1.5707963267948966+0.9350931316301407j)</p>
</blockquote>

<p>Is there a way in which can I convert this value to degrees? math.degrees does not work since it cannot compute with complex values.</p>

<p>Thanks!</p>

<p>To use math.degrees(), you need to get the real part of the complex number first.</p>

<pre><code>import cmath
import math
rad = cmath.asin( 1.47 )
math.degrees( rad.real )
</code></pre>

python python-2.7