48 for(
int i=0; i<other.
_nvert; i++){
70 for(
int i=0; i<other.
_nvert; i++){
82 this->
_shape.
x =
new double[numVertx];
83 this->
_shape.
y =
new double[numVertx];
86 for(
int i=0;i<numVertx;i++)
113 Vertex pStart,pEnd, intersect;
122 for(
int i=0;i <
_nvert;i++)
130 if(intersect.
x != -999.0 && intersect.
y != -999.0)
149 double denom = ((end1.
x - start1.
x) * (end2.
y - start2.
y)) -
150 ((end1.
y - start1.
y) * (end2.
x - start2.
x));
156 double numer = ((start1.
y - start2.
y) * (end2.
x - start2.
x)) -
157 ((start1.
x - start2.
x) * (end2.
y - start2.
y));
159 double r = numer / denom;
161 double numer2 = ((start1.
y - start2.
y) * (end1.
x - start1.
x)) -
162 ((start1.
x - start2.
x) * (end1.
y - start1.
y));
164 double s = numer2 / denom;
167 if ((r < 0 || r > 1) || (s < 0 || s > 1))
171 result.
x = start1.
x + (r * (end1.
x - start1.
x));
172 result.
y = start1.
y + (r * (end1.
y - start1.
y));
double GetXVerticie(int num)
bool VertexInPolygon(Vertex vertex)
double GetYVerticie(int num)
Polygon & operator=(const Polygon &other)
Vertex FindLineIntersectLine(Vertex start1, Vertex end1, Vertex start2, Vertex end2)
bool LineOverlapsPolygon(Vertex start, Vertex end)