title: JS drawing a line from the edge of a circle to another circle edge
body: <p>I'm trying to draw a line from the edges of the two circles in HTML5 canvas. So, I know the coordinates of the centers of two circles and their radius.</p>
  
  <ol>
  <li>Circles drawn randomly.</li>
  <li>Line should move from the edge of one circle to the other.</li>
  </ol>
  
  <p>Please help!</p>
  
  <p>P.S. Sorry for my english :)</p>
  
  <p>UPDATE:</p>
  
  <p>I'm trying this, but how to know angle?</p>
  
  <pre><code>from_line_x = circle1.x + circle1.radius * Math.cos(Math.PI * angle);
  from_line_y = circle1.y + cirlce1.radius * Math.sin(Math.PI * angle);
  to_line_x = circle2.x - circle2.radius * Math.cos(Math.PI * angle);
  to_line_y = circle2.y - circle2.radius * Math.sin(Math.PI * angle);
  </code></pre>
  
  <p>UPDATE2:</p>
  
  <p>I think I found how to find the angle. But as a circle drawn randomly, the line is drawn is not always true. How then should look algorithm?</p>
  
  <p>Sorry for my english again.</p>