Artifact 0f1f35288c2dfafe8dc2a60c44c65fb22fa3de26:
0000: 74 79 70 65 64 65 66 20 6c 6f 6e 67 20 64 6f 75 typedef long dou
0010: 62 6c 65 20 4c 44 3b 0a 74 79 70 65 64 65 66 20 ble LD;.typedef
0020: 63 6f 6d 70 6c 65 78 3c 4c 44 3e 20 43 4d 50 3b complex<LD> CMP;
0030: 0a 0a 62 6f 6f 6c 20 6c 69 6e 65 5f 63 69 72 63 ..bool line_circ
0040: 6c 65 28 43 4d 50 20 6c 61 2c 20 43 4d 50 20 6c le(CMP la, CMP l
0050: 62 2c 20 43 4d 50 20 63 2c 20 4c 44 20 72 2c 20 b, CMP c, LD r,
0060: 43 4d 50 2a 20 70 31 2c 20 43 4d 50 2a 20 70 32 CMP* p1, CMP* p2
0070: 29 0a 7b 0a 09 43 4d 50 20 76 20 3d 20 28 6c 62 ).{..CMP v = (lb
0080: 2d 6c 61 29 20 2f 20 61 62 73 28 6c 62 2d 6c 61 -la) / abs(lb-la
0090: 29 3b 0a 09 43 4d 50 20 6f 20 3d 20 28 63 2d 6c );..CMP o = (c-l
00a0: 61 29 20 2f 20 76 3b 0a 09 69 66 28 20 61 62 73 a) / v;..if( abs
00b0: 28 6f 2e 69 6d 61 67 28 29 29 20 3e 20 72 20 29 (o.imag()) > r )
00c0: 0a 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b ...return false;
00d0: 0a 09 4c 44 20 64 78 20 3d 20 73 71 72 74 28 72 ..LD dx = sqrt(r
00e0: 2a 72 20 2d 20 6f 2e 69 6d 61 67 28 29 2a 6f 2e *r - o.imag()*o.
00f0: 69 6d 61 67 28 29 29 3b 0a 09 2a 70 31 20 3d 20 imag());..*p1 =
0100: 6c 61 20 2b 20 28 6f 2e 72 65 61 6c 28 29 2d 64 la + (o.real()-d
0110: 78 29 2a 76 3b 0a 09 2a 70 32 20 3d 20 6c 61 20 x)*v;..*p2 = la
0120: 2b 20 28 6f 2e 72 65 61 6c 28 29 2b 64 78 29 2a + (o.real()+dx)*
0130: 76 3b 0a 09 72 65 74 75 72 6e 20 74 72 75 65 3b v;..return true;
0140: 0a 7d 0a .}.