Calculating angle using Pythagoras' theorem
<p>I'm finishing an assignment. But I've been bashing my head against one problem with it and can't work it out.</p>

<p>I'm supposed to be calculating the angle in degrees and distance between 2 points, rounded to 3 decimal places. Everything is working fine but the angle it's putting out is wrong</p>

<pre><code>double angleInRadians = Math.Atan2(point2X, point1X) - Math.Atan2(point2Y, point1Y);
</code></pre>

<p>This should be correct right? But it just keeps saying 0 when it should be saying 45 degrees. I've checked and the calculation for converting it into degree is correct, it's getting the angle in radians that is playing up</p>

<p>Does anyone know what's wrong with it?</p>