title: Calculating an angle of a triangle with Javascript?
body: <p>Sorry for the pretty dumb question. 
  I'm slowly learning maths from scratch.</p>
  
  <p>I would like to calculate the angle of triangle through javascript. </p>
  
  <p>I calculate the lengths of the sides,</p>
  
  <pre><code>Ab = Math.abs(b.x - c.x);
  Ac = Math.abs(b.y - c.y);
  
  A = Math.sqrt((Ab*Ab) + (Ac*Ac));
  
  Bb = Math.abs(a.x - c.x);
  Bc = Math.abs(a.y - c.y);
  
  B = Math.sqrt((Bb*Bb) + (Bc*Bc));
  
  Cb = Math.abs(a.x - b.x);
  Cc = Math.abs(a.y - b.y);
  
  C = Math.sqrt((Cb*Cb) + (Cc*Cc));
  </code></pre>
  
  <p>And then I get to this point:</p>
  
  <pre><code>angleB = Math.cos(((C*C) + (A*A) - (B*B))/(2*C*A));
  </code></pre>
  
  <p>However, I get a completely wrong number. Why is this so? </p>