9#include "trg/trg/Area2D.h"
36 const float xDiff = x1.
x() - x0.
x();
37 const float yDiff = x1.
y() - x0.
y();
38 const float a = yDiff / xDiff;
39 const float b = x0.
x() - a * x0.
x();
43 for (
unsigned i = 0; i < 2; i++) {
47 crossPoint[nFound++] = p;
48 if (nFound == 2)
return;
52 crossPoint[nFound++] = q;
53 if (nFound == 2)
return;
TRGPoint2D _c[2]
2D points
A class to represent a point in 2D.
double y(void) const
y of the point
virtual ~TRGArea2D()
Destructor.
TRGArea2D(const TRGPoint2D &leftBottom, const TRGPoint2D &rightUpper)
Contructor.
double x(void) const
x of the point
bool inArea(const TRGPoint2D &x) const
returns true if give point is in the area.
void cross(const TRGPoint2D &x0, const TRGPoint2D &x1, unsigned &nFound, TRGPoint2D crossPoint[2]) const
returns cross-points.
Abstract base class for different kinds of events.