10 :
cv::Vec<double,3> ( l ) {
38 double r = sqrt ( this->val[0]*this->val[0] + this->val[1]*this->val[1] );
39 this->val[0] /= r, this->val[1] /= r, this->val[2] /= r;
42 return this->val[0]*x + this->val[1]*y + this->val[2];
51 return Point2D ( x - d *
a(), y - d *
b() );
58 cv::Vec<double,3> h = this->cross ( l );
59 return Point2D ( h[0]/h[2],h[1]/h[2] );
62 return cv::Vec<double,2> ( this->val[0], this->val[1] );
65 this->val[0] = y0-y1, this->val[1] = x1-x0, this->val[2] = x0*y1-y0*x1;
Point2D pointOnLine(const double &x, const double &y) const
Point2D intersection(const Line2D &l) const
cv::Vec< double, 2 > normal() const
Line2D & set(const double &x0, const double &y0, const double &x1, const double &y1, bool normalize=true)
cv::Vec< double, 3 > & cv()
double distanceTo(const double &x, const double &y) const