title: Conversion from radians to degrees
body: <p>I am trying to do a simple trigonometric calculation in C++. The following is an example of the problem I am having with this. As far as I know, C++ works in radians, not degrees. So conversion from radians to degrees should be a simple case of multiplying by 180 and dividing by pi. A simple test is tan(45), which should equate 1. The following program produces a value of 92.8063 however...</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  #include &lt;math.h&gt;
  
  int main(){
      double a,b;
      a = tan(45);
      b = a * 180 / 3.14159265;
      cout &lt;&lt; b;
      return 0;
  }
  </code></pre>
  
  <p>What is wrong?</p>