def isect_polygon__naive(points):
isect = []<EOL>n = len(points)<EOL>if Real is float:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>points = [(Real(p[<NUM_LIT:0>]), Real(p[<NUM_LIT:1>])) for p in points]<EOL><DEDENT>for i in range(n):<EOL><INDENT>a0, a1 = points[i], points[(i + <NUM_LIT:1>) % n]<EOL>for j in range(i + <NUM_LIT:1>, n):<EOL><INDENT>b0, b1 = points[j], points[(j + <NUM_LIT:1>) % n]<EOL>if a0 not in (b0, b1) and a1 not in (b0, b1):<EOL><INDENT>ix = isect_seg_seg_v2_point(a0, a1, b0, b1)<EOL>if ix is not None:<EOL><INDENT>if USE_IGNORE_SEGMENT_ENDINGS:<EOL><INDENT>if ((len_squared_v2v2(ix, a0) < NUM_EPS_SQ or<EOL>len_squared_v2v2(ix, a1) < NUM_EPS_SQ) and<EOL>(len_squared_v2v2(ix, b0) < NUM_EPS_SQ or<EOL>len_squared_v2v2(ix, b1) < NUM_EPS_SQ)):<EOL><INDENT>continue<EOL><DEDENT><DEDENT>isect.append(ix)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return isect<EOL>
Brute force O(n2) version of ``isect_polygon`` for test validation.