title: How to get back from atan2 angle back to Coordinate
body: <p>I calculated the angle of <code>(-6/35)</code> by using <code>atan2(-6/35)</code>.
  The result is <code>-9.7275785514016047</code>.</p>
  
  <p>Now to get back I used  the formula from <a href="https://en.wikipedia.org/wiki/Polar_coordinate_system#Converting_between_polar_and_Cartesian_coordinates" rel="nofollow noreferrer">Wikipedia</a></p>
  
  <p><a href="https://i.stack.imgur.com/kC6Yw.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kC6Yw.gif" alt="enter image description here"></a></p>
  
  <pre><code>distance = sqrt(6*6+35*35);
  angleRelativeToPatternOrigin = -9.7275785514016047;
  
  double  x1 = distance * cos(angleRelativeToPatternOrigin);
  double  y1 = distance * sin(angleRelativeToPatternOrigin);
  </code></pre>
  
  <p>I exptected to get the coordinares <code>(-6/35)</code>
  But I got (<code>-33.895012797701419/10.589056022311761</code>)</p>
  
  <p>So I think this is wrong because <code>atan2</code> is defined over <strong>4</strong> quadrants and <code>sin</code> and <code>cos</code> are only defined over <strong>2</strong>.</p>
  
  <p>Is this correct?
  How to do it right?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Now, first of all I am sorry for describing my question in a bad way.
  I actually did the following</p>
  
  <pre><code>int main(int argc, char* argv[])
  {
     int x = -6;
     int y = 35;
     double radian = atan2(x,y);  // this was wrong. atan2(y,x) is correct.
     double degree = radian  * (360 / (2 * 3.14159265358979323846));
     double distance = sqrt(6*6+35*35);
  
     double x1 = distance * cos(degree); // Wrong because I used degree
     double y1 = distance * sin(degree); // instead of radian
  
     return 0;
  }
  </code></pre>