Go to the documentation of this file.
   16     : 
Line2D ( x0, y0, x1, y1, true )
 
   35     return atan2 ( dy,dx );
 
   56     return p0() == o.
p0() && 
p1() == o.
p1();
 
   83     const double px = 
x1()-
x0();
 
   84     const double py = 
y1()-
y0();
 
   85     const double l2 = px*px + py*py;
 
   86     double u = ( ( 
p.x() - 
x0() ) * px + ( 
p.y() - 
y0() ) * py ) / l2;
 
   88     else if ( u < 0 ) u = 0;
 
   89     const double xk = 
x0() + u * px;
 
   90     const double yk = 
y0() + u * py;
 
   93     return dx*dx + dy*dy ;
 
   97     double px = 
x1()-
x0();
 
   98     double py = 
y1()-
y0();
 
   99     double l2 = px*px + py*py;
 
  100     double  u =  ((
p.x() - 
x0()) * px + (
p.y() - 
y0()) * py) / l2;
 
  102     else if (u < 0){ u = 0; }
 
  106     double px = 
x1()-
x0();
 
  107     double py = 
y1()-
y0();
 
  
const double & x1() const
double closestPointLineSegmentRatio(const Point2D &p) const
const double & x0() const
const Point2D & p0() const
LineSegment2D()
the lines endpoints
double distanceTo(const Point2D &p, double &dx, double &dy) const
double distanceTo(const Point2D &p) const
const double length() const
Point2D closestPointTo(const Point2D &p) const
const double & y1() const
const double & y0() const
Line2D & set(const double &x0, const double &y0, const double &x1, const double &y1, bool normalize=true)
const Line2D & line() const
LineSegment2D & set(const double &x0, const double &y0, const double &x1, const double &y1)
Point2D & set(double x, double y)
bool operator==(const LineSegment2D &o) const
comparison operator
const Point2D & p1() const
double distanceSqrTo(const Point2D &p, double &dx, double &dy) const
tuw_geometry
Author(s): Markus Bader
autogenerated on Sun Feb 26 2023 03:25:40