{"id":163,"date":"2021-11-08T23:54:49","date_gmt":"2021-11-08T15:54:49","guid":{"rendered":"http:\/\/139.224.63.49\/?p=163"},"modified":"2021-11-08T23:54:49","modified_gmt":"2021-11-08T15:54:49","slug":"%e5%88%a4%e6%96%ad%e7%82%b9%e5%9c%a8%e7%ba%bf%e7%9a%84%e5%b7%a6%e8%be%b9%e8%bf%98%e6%98%af%e5%8f%b3%e8%be%b9%e8%bf%98%e6%98%af%e5%9c%a8%e7%ba%bf%e4%b8%8a","status":"publish","type":"post","link":"http:\/\/iamnear.top\/?p=163","title":{"rendered":"\u5224\u65ad\u70b9\u5728\u7ebf\u7684\u5de6\u8fb9\u8fd8\u662f\u53f3\u8fb9\u8fd8\u662f\u5728\u7ebf\u4e0a"},"content":{"rendered":"\n<p>\u8fd9\u4e2a\u7b97\u6cd5\u9047\u5230\u4e86\uff0c\u867d\u7136\u6709\u70b9\u601d\u8def\uff0c\u4f46\u662f\u4e4b\u524d\u6ca1\u5199\u8fc7<\/p>\n\n\n\n<p>\u6211\u8003\u8651\u5e94\u8be5\u662f\u4e00\u6761\u76f4\u7ebf\u628a\u5e73\u9762\u5212\u5206\u6210\u4e24\u5757\uff0c\u5c06\u8be2\u95ee\u70b9\u7684\u5750\u6807\u5e26\u5165\u76f4\u7ebf\uff0c\u5927\u4e8e0\u548c\u5c0f\u4e8e0\u5219\u8bf4\u660e\u8be2\u95ee\u70b9\u5728\u76f4\u7ebf\u7684\u4e24\u4fa7<\/p>\n\n\n\n<p>\u7136\u800c\u540e\u6765\u6211\u8fd8\u662f\u9009\u62e9\u4e86\u76f4\u63a5\u767e\u5ea6\u3002\u3002<\/p>\n\n\n\n<p><strong>\u4ee5\u4e0b\u5185\u5bb9\u6765\u81ea<a href=\"https:\/\/www.cnblogs.com\/carekee\/articles\/2299546.html\">https:\/\/www.cnblogs.com\/carekee\/articles\/2299546.html<\/a>,\u590d\u5236\u5230\u8fd9\u91cc\u5907\u5fd8<\/strong>\uff0c\u8fd9\u4f4d\u5144\u603b\u7ed3\u7684\u975e\u5e38\u7cbe\u70bc<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5224\u65ad\u70b9\u5728\u7ebf\u7684\u5de6\u8fb9\u8fd8\u662f\u53f3\u8fb9\u5728\u6784\u5efa\u4e09\u89d2\u7f51\u65f6\u662f\u975e\u5e38\u91cd\u8981\u7684<\/p>\n\n\n\n<p>\u4ee5\u53ca\u4e24\u70b9p1(x1,y1),p2(x2,y2),\u5224\u65ad\u70b9p(x,y)\u5728\u7ebf\u7684\u5de6\u8fb9\u8fd8\u662f\u53f3\u8fb9\u3002<\/p>\n\n\n\n<p>1.<\/p>\n\n\n\n<p>bool LeftOfLine(const ZCoord2D&amp; p, const ZCoord2&amp; p1, const ZCoord2D&amp; p2)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; double tmpx = (p1.x &#8211; p2.x) \/ (p1.y &#8211; p2.y) * (p.y &#8211; p2.y) + p2.x;<\/p>\n\n\n\n<p>&nbsp;&nbsp; &nbsp;if (tmpx &gt; p.x)\/\/\u5f53tmpx&gt;p.x\u7684\u65f6\u5019\uff0c\u8bf4\u660e\u70b9\u5728\u7ebf\u7684\u5de6\u8fb9\uff0c\u5c0f\u4e8e\u5728\u53f3\u8fb9\uff0c\u7b49\u4e8e\u5219\u5728\u7ebf\u4e0a\u3002<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br>return false;<br>}<\/p>\n\n\n\n<p>2.<\/p>\n\n\n\n<p>\u53e6\u5916\u4e00\u79cd\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p>Tmp = (y1 \u2013 y2) * x + (x2 \u2013 x1) * y + x1 * y2 \u2013 x2 * y1<\/p>\n\n\n\n<p>Tmp &gt; 0 \u5728\u5de6\u4fa7<\/p>\n\n\n\n<p>Tmp = 0 \u5728\u7ebf\u4e0a<\/p>\n\n\n\n<p>Tmp &lt; 0 \u5728\u53f3\u4fa7<\/p>\n\n\n\n<p>3.<\/p>\n\n\n\n<p>\u8bbe\u7ebf\u6bb5\u7aef\u70b9\u4e3a\u4ece A(x1, y1)\u5230 B(x2, y2), \u7ebf\u5916\u4e00\u70b9 P(x0\uff0cy0)\uff0c<br>\u5224\u65ad\u8be5\u70b9\u4f4d\u4e8e\u6709\u5411\u7ebf A\u2192B \u7684\u90a3\u4e00\u4fa7\u3002<br>a = ( x2-x1, y2-y1)<br>b = (x0-x1, y0-y1)<br>a x b = | a | | b | sin\u03c6 (\u03c6\u4e3a\u4e24\u5411\u91cf\u7684\u5939\u89d2)<br>| a | | b |&nbsp; \u2260 0 \u65f6\uff0c&nbsp; a x b&nbsp; \u51b3\u5b9a\u70b9 P\u7684\u4f4d\u7f6e<br>\u6240\u4ee5&nbsp; a x b&nbsp; \u7684 z \u65b9\u5411\u5927\u5c0f\u51b3\u5b9a P\u4f4d\u7f6e<br>(x2-x1)(y0-y1) \u2013 (y2-y1)(x0-x1)&nbsp; &gt;&nbsp; 0&nbsp;&nbsp; \u5de6\u4fa7<br>(x2-x1)(y0-y1) \u2013 (y2-y1)(x0-x1)&nbsp; &lt;&nbsp; 0&nbsp;&nbsp; \u53f3\u4fa7&nbsp;<br>(x2-x1)(y0-y1) \u2013 (y2-y1)(x0-x1)&nbsp; =&nbsp; 0&nbsp;&nbsp; \u7ebf\u6bb5\u4e0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e2a\u7b97\u6cd5\u9047\u5230\u4e86\uff0c\u867d\u7136\u6709\u70b9\u601d\u8def\uff0c\u4f46\u662f\u4e4b\u524d\u6ca1\u5199\u8fc7 \u6211\u8003\u8651\u5e94\u8be5\u662f\u4e00\u6761\u76f4\u7ebf\u628a\u5e73\u9762\u5212\u5206\u6210\u4e24\u5757\uff0c\u5c06\u8be2\u95ee\u70b9\u7684\u5750\u6807\u5e26&hellip; <a href=\"http:\/\/iamnear.top\/?p=163\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">\u5224\u65ad\u70b9\u5728\u7ebf\u7684\u5de6\u8fb9\u8fd8\u662f\u53f3\u8fb9\u8fd8\u662f\u5728\u7ebf\u4e0a<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-163","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-uncategorized","7":"h-entry","9":"h-as-article"},"_links":{"self":[{"href":"http:\/\/iamnear.top\/index.php?rest_route=\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/iamnear.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/iamnear.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/iamnear.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/iamnear.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":1,"href":"http:\/\/iamnear.top\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":164,"href":"http:\/\/iamnear.top\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions\/164"}],"wp:attachment":[{"href":"http:\/\/iamnear.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/iamnear.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/iamnear.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}