Diff
Not logged in

Differences From Artifact [05f672d15009c4b5]:

To Artifact [f28d7402b7cb4529]:


2 //------------------------------------------------------------- 2 //------------------------------------------------------------- 3 // The circle passing three points 3 // The circle passing three points 4 // 4 // 5 // Verified by 5 // Verified by 6 // - AOJ 0012 (only triangles) 6 // - AOJ 0012 (only triangles) 7 //------------------------------------------------------------- 7 //------------------------------------------------------------- 8 8 9 double outer_prod( CMP a, CMP b ) | 9 double outer_prod(const CMP& a, const CMP& b) { return imag(conj(a)*b); } 10 { < 11 return (a.real()*b.imag() - b.real()*a.imag())/2; < 12 } < 13 10 14 bool point_in_polygon( vector<CMP>& ps, CMP p ) 11 bool point_in_polygon( vector<CMP>& ps, CMP p ) 15 { 12 { 16 bool in = false; 13 bool in = false; 17 for(int i=0; i<ps.size(); ++i) { 14 for(int i=0; i<ps.size(); ++i) { 18 CMP a = ps[i] - p; 15 CMP a = ps[i] - p; 19 CMP b = ps[(i+1)%ps.size()] - p; 16 CMP b = ps[(i+1)%ps.size()] - p;