title: Random point inside triangle inside Java
body: <p>I'm trying to get random point inside triangle in Java.</p>
  
  <p>I have three points with x, y coordinates and trying to use this formula.</p>
  
  <pre><code>P = (1 - sqrt(r1)) * A + (sqrt(r1) * (1 - r2)) * B + (sqrt(r1) * r2) * C
  </code></pre>
  
  <p>Where r1 and r2 are random double from 0 to 1.
   But, how to define A, B, C? Because now A have x and y coordinates.</p>