64 location[0] = loc0[0];
65 location[1] = loc0[1];
73 location[0] = loc1[0];
74 location[1] = loc1[1];
78 if ((e0i == 1) && (e1i == 1))
80 if ((loc0[0]-p).mag2() < (loc1[0]-p).mag2())
82 location[0] = loc0[0];
83 location[1] = loc1[0];
87 location[0] = loc1[0];
88 location[1] = loc0[0];
99 location[0] = loc2[0];
100 location[1] = loc2[1];
104 if ((e0i == 0) && (e1i == 0) && (e2i == 0))
return false;
106 if ((e0i == 1) && (e2i == 1))
108 if ((loc0[0]-p).mag2() < (loc2[0]-p).mag2())
110 location[0] = loc0[0];
111 location[1] = loc2[0];
115 location[0] = loc2[0];
116 location[1] = loc0[0];
121 if ((e1i == 1) && (e2i == 1))
123 if ((loc1[0]-p).mag2() < (loc2[0]-p).mag2())
125 location[0] = loc1[0];
126 location[1] = loc2[0];
130 location[0] = loc2[0];
131 location[1] = loc1[0];
182 if (ss < 0)
return 0;
184 if (t < 0 || t > 1)
return 0;
189 location[0] = p0 + ss*d0;
197 sqrKross = kross * kross;
210 if (s0 < s1) {smin =
s0; smax =
s1;}
211 else {smin =
s1; smax =
s0;}
213 if (smax < 0.0)
return 0;
217 location[1] = p0 + smax*d0;
222 location[0] = p0 + smin*d0;
223 location[1] = p0 + smax*d0;
239 return v1.
x()*v2.
y() - v1.
y()*v2.
x();