{"id":111,"date":"2009-11-05T23:02:02","date_gmt":"2009-11-05T15:02:02","guid":{"rendered":"http:\/\/hgc43160.chinaw3.com\/?p=111"},"modified":"2009-11-05T23:02:02","modified_gmt":"2009-11-05T15:02:02","slug":"%e4%ba%8c%e7%bb%b4%e4%b8%96%e7%95%8c%e4%b8%ad%e7%9a%84%e6%97%8b%e8%bd%ac","status":"publish","type":"post","link":"http:\/\/www.hyzgame.com\/?p=111","title":{"rendered":"\u4e8c\u7ef4\u4e16\u754c\u4e2d\u7684\u65cb\u8f6c"},"content":{"rendered":"<p><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u9996\u5148\uff0c\u5728\u89e3\u6790\u51e0\u4f55\u4e2d\u6211\u4eec\u53ef\u4ee5\u627e\u5230\u4ee5\u4e0b\u516c\u5f0f\uff1a<\/span><\/p>\n<div>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#c0c0c0\">\n<tbody>\n<tr>\n<td width=\"100%\" bgcolor=\"#e4e4e4\"><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">x&#8217;=x*cos(ang)-y*sin(ang)<br \/>\ny&#8217;=x*sin(ang)+y*cos(ang)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\"> \u8fd9\u4e2a\u516c\u5f0f\u662f\u4ee5\u539f\u70b9<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">(0,0)<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u4e3a\u4e2d\u5fc3\uff0c\u5c06\u70b9<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">(x,y)<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u65cb\u8f6c<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">ang<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u5ea6\uff0c\u65cb\u8f6c\u540e\u7684\u5750\u6807\u4e3a<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">(x&#8217;,y&#8217;)<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u3002\u4e0d\u8fc7\u8fd9\u53ea\u662f\u4ee5\u539f\u70b9\u4e3a\u4e2d\u5fc3\u8fdb\u884c\u65cb\u8f6c\u7684\uff0c\u5982\u679c\u6211\u4eec\u60f3\u4ee5\u4efb\u610f\u70b9\u4e3a\u4e2d\u5fc3\u65cb\u8f6c\u5462\uff01\u516c\u5f0f\u53d8\u5f62\u5982\u4e0b\uff1a<\/span><\/p>\n<div>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#e4e4e4\">\n<tbody>\n<tr>\n<td width=\"100%\"><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">x&#8217;=zx+(x-zx)*cos(ang)-(y-zy)*sin(ang)<br \/>\ny&#8217;=zy+(x-zx)*sin(ang)+(y-zy)*cos(ang)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\"> \u597d\uff0c\u8fd9\u4e5f\u5c31\u662f\u6211\u4eec\u60f3\u8981\u7684\u7ed3\u679c\u4e86\u3002\u4ee5<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">(zx,zy)<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u4e3a\u4e2d\u5fc3\uff0c\u5c06\u70b9<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">(x,y)<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u65cb\u8f6c<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">ang<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u5ea6\uff0c\u65cb\u8f6c\u540e\u7684\u5750\u6807\u4e3a<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">(x&#8217;,y&#8217;)<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u3002<\/span><\/p>\n<p><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\"> <\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u7531\u4e8e\u5728\u6807\u51c6<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">C\/C++<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u5e93\u4e2d\uff0c<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">sin<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u548c<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">cos<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u6240\u8981\u6c42\u7684\u53c2\u6570\u4e3a\u5f27\u5ea6\uff0c\u800c\u5e76\u975e\u89d2\u5ea6\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u8f6c\u6362\u3002<\/span><\/p>\n<div>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#e4e4e4\">\n<tbody>\n<tr>\n<td width=\"100%\"><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">\u5f27\u5ea6=\u89d2\u5ea6*\u5706\u5468\u7387\/180<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\"> \u6309\u4ee5\u4e0a\uff0c\u6700\u540e\u7684\u6807\u51c6<\/span><span style=\"font-family: Arial; color: #000000; font-size: medium;\">C\/C++<\/span><span style=\"font-family: \u6977\u4f53_GB2312; color: #000000; font-size: medium;\">\u7a0b\u5e8f\u5982\u4e0b\uff1a<\/span><\/p>\n<div>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#e4e4e4\">\n<tbody>\n<tr>\n<td width=\"100%\"><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">float          x,y;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u539f\u59cb\u70b9\u5750\u6807<br \/>\nfloat rx,ry;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u65cb\u8f6c\u4e2d\u5fc3\u70b9\u5750\u6807<br \/>\nfloat nx,ny;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u65cb\u8f6c\u540e\u7684\u70b9\u5750\u6807<br \/>\nfloat ang;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0          \/\/\u65cb\u8f6c\u89d2\u5ea6(0-360)<br \/>\nfloat as,ac;<\/span><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">\u2026\u2026<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">as=sin(ang*M_PI\/180.0);<br \/>\nac=cos(ang*M_PI\/180.0);<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53; font-size: small;\">nx=rx+((x-rx)*ac-(y-ry)*as);<br \/>\nny=ry+((x-rx)*as+(y-ry)*ac);<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<hr size=\"1\" \/>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff0c\u5728\u89e3\u6790\u51e0\u4f55\u4e2d\u6211\u4eec\u53ef\u4ee5\u627e\u5230\u4ee5\u4e0b\u516c\u5f0f\uff1a x&#8217;=x*cos(ang)-y*sin(ang) y&#038;# [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-2d"],"_links":{"self":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":1,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":112,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions\/112"}],"wp:attachment":[{"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hyzgame.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}