title: Draw the lines detected by cv::HoughLines
body: <p>On this site(<a href="http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.html" rel="nofollow">tutorial</a>), it show us how to draw the lines detected by cv::HoughLines,but I can't understand how could it find out the Point between the lines.</p>
  
  <pre><code>    for( size_t i = 0; i &lt; lines.size(); i++ )
    {
       float rho = lines[i][0], theta = lines[i][1];
       Point pt1, pt2;
       double a = cos(theta), b = sin(theta);
       double x0 = a*rho, y0 = b*rho;
       pt1.x = cvRound(x0 + 1000*(-b)); //??
       pt1.y = cvRound(y0 + 1000*(a)); //??
       pt2.x = cvRound(x0 - 1000*(-b)); //??
       pt2.y = cvRound(y0 - 1000*(a)); //??
       line( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
    }
  </code></pre>
  
  <p>Example from the openCV cookbook, I could understand the reason these codes
  but it is more verbose</p>
  
  <pre><code>for(auto const &amp;data : lines){
      float const rho = data[0];
      float const theta = data[1];
  
      if((theta &lt; PI/4. || theta &gt; 3. * PI/4.)){
          cv::Point pt1(rho / std::cos(theta), 0);
          cv::Point pt2( (rho - result.rows * std::sin(theta))/std::cos(theta), result.rows);
          cv::line(result, pt1, pt2, cv::Scalar(255), 1);
      }else if{
          cv::Point pt1(0, rho / std::sin(theta));
          cv::Point pt2(result.cols, (rho - result.cols * std::cos(theta))/std::sin(theta));
          cv::line(result, pt1, pt2, cv::Scalar(255), 1);
      }
  }
  </code></pre>