{"id":422108,"date":"2021-04-01T18:38:56","date_gmt":"2021-04-01T10:38:56","guid":{"rendered":"http:\/\/4563.org\/?p=422108"},"modified":"2021-04-01T18:38:56","modified_gmt":"2021-04-01T10:38:56","slug":"%e6%83%b3%e9%97%ae%e4%b8%80%e4%b8%8b%e6%9c%89%e5%a4%a7%e4%bd%ac%e5%9c%a8%e8%b0%b7%e6%ad%8c%e5%b7%a5%e4%bd%9c%e8%bf%87%e5%90%97%ef%bc%9f%e5%9c%a8%e8%b0%b7%e6%ad%8c%e5%b7%a5%e4%bd%9c%e6%98%af%e4%bb%80","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=422108","title":{"rendered":"\u60f3\u95ee\u4e00\u4e0b\u6709\u5927\u4f6c\u5728\u8c37\u6b4c\u5de5\u4f5c\u8fc7\u5417\uff1f\u5728\u8c37\u6b4c\u5de5\u4f5c\u662f\u4ec0\u4e48\u4f53\u9a8c\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u60f3\u95ee\u4e00\u4e0b\u6709\u5927\u4f6c\u5728\u8c37\u6b4c\u5de5\u4f5c\u8fc7\u5417\uff1f\u5728\u8c37\u6b4c\u5de5\u4f5c\u662f\u4ec0\u4e48\u4f53\u9a8c\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zzzrf <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p><strong>\u4eca\u5929\u5237\u9898\u5237\u5230\u4e00\u4efd\u8c37\u6b4c\u7684\u9762\u8bd5\u771f\u9898\uff0c\u505a\u7740\u505a\u7740\u6211\u5c31\u79bb\u9898\u4e86\uff0c\u7a81\u7136\u5f88\u597d\u5947\u5728\u8c37\u6b4c\u4e0a\u73ed\u662f\u4ec0\u4e48\u6837\u7684\u4f53\u9a8c\u3002<\/strong> <\/p>\n<p><strong>\u56e0\u4e3a\u5927\u5bb6\u90fd\u8bf4 Google \u662f\u8457\u540d\u7684\u201c\u517b\u8001\u201d\u5927\u5382\uff0c\u4f46\u662f\uff0c\u53bb\u8c37\u6b4c\u5c31\u80fd\u517b\u8001\u4e86\u5417\uff1f\u5927\u5bb6\u5de5\u4f5c\u7684\u6c1b\u56f4\u662f\u600e\u4e48\u6837\u7684\uff1f<\/strong> <\/p>\n<p>\u522b\u8bf4\u6211\u4e0d\u597d\u597d\u5237\u9898\u51c0\u778e\u60f3\uff0c\u653e\u4e2a\u9898\u89e3\u8bc1\u660e\u81ea\u5df1\u8fd8\u662f\u6709\u8ba4\u771f\u505a\u5b8c\u9898\u76ee\u7684~<\/p>\n<ul>\n<li>\u61d2\u5f97\u590d\u5236\u4e86\uff0c\u539f\u9898\u5728\u8fd9\u91cc<\/li>\n<\/ul>\n<p>\u5176\u5b9e\u8fd9\u4e2a\u95ee\u9898\u505a\u6cd5\u6709\u5f88\u591a\uff0c\u5728\u6b64\u4ec5\u63d0\u4f9b\u4e00\u79cd\u601d\u8def\u3002<\/p>\n<p>\u8fd9\u91cc\u53ef\u4ee5\u5c06\u8fde\u7ebf\u8f68\u8ff9\u5f62\u6210\u4e00\u4e2a\u77e9\u5f62\uff0c\u5224\u65ad\u77e9\u5f62\u548c B \u662f\u5426\u76f8\u4ea4\u3002\u7136\u540e\u5728\u8d77\u70b9\u548c\u7ec8\u70b9\u7279\u6b8a\u5224\u65ad\u3002<\/p>\n<pre><code>class Solution:     \"\"\"     @param position: the position of circle A,B and point P.     @return: if two circle intersect return 1, otherwise -1.     \"\"\"     #\u53c9\u79ef AB\u00d7AC     def xmult(self, B, C, A):         return (B[0] - A[0])*(C[1] - A[1]) - (C[0] - A[0])*(B[1] - A[1])     #\u4e24\u70b9\u95f4\u8ddd\u79bb     def distance(self, A, B):         return math.sqrt((A[0] - B[0])*(A[0] - B[0]) + (A[1] - B[1])*(A[1] - B[1]))     #\u70b9 A \u5230\u76f4\u7ebf BC \u8ddd\u79bb     def dis_ptoline(self, A, B, C):         return abs(self.xmult(A,B,C))\/self.distance(B,C)          def IfIntersect(self, position):         A = [position[0], position[1]]         ra = position[2]         B = [position[3], position[4]]         rb = position[5]         P = [position[6], position[7]]         #\u8fc7\u70b9 B \u4f5c\u76f4\u7ebf AP \u7684\u5782\u7ebf\uff0cM \u4e3a\u8be5\u5782\u7ebf\u4e0a\u4e00\u70b9\uff08 A \u548c P \u4e0d\u91cd\u5408\u65f6 M \u70b9\u4e0d\u4e0e B \u91cd\u5408\uff09         M = [B[0] - (P[1] - A[1]), B[1] + (P[0] - A[0])]         dmin = 0.0         dmax = 0.0                  #\u82e5\u5706 A \u79fb\u52a8\u8fc7\u7a0b\u4e2d\u4f1a\u7ecf\u8fc7 B \u70b9\u5230\u76f4\u7ebf AP \u5782\u7ebf\u7684\u4ea4\u70b9         if self.xmult(A, B, M) * self.xmult(B, P, M) &gt; 0 :             dmin = self.dis_ptoline(B, A, P)         else :             dmin = min(self.distance(A, B), self.distance(P, B))         dmax = max(self.distance(A, B), self.distance(P, B))         if dmin &gt; ra + rb or dmax &lt; abs(ra - rb):             return -1         return 1 <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u95ee\u4e00\u4e0b\u6709\u5927\u4f6c\u5728\u8c37\u6b4c\u5de5\u4f5c\u8fc7\u5417\uff1f\u5728\u8c37&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/422108"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=422108"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/422108\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=422108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=422108"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=422108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}