{"id":943,"date":"2025-11-08T06:26:41","date_gmt":"2025-11-08T06:26:41","guid":{"rendered":"https:\/\/tensorzen.blog\/?p=943"},"modified":"2025-11-08T06:26:41","modified_gmt":"2025-11-08T06:26:41","slug":"transform2d","status":"publish","type":"post","link":"https:\/\/tensorzen.blog\/?p=943","title":{"rendered":"Transform2D"},"content":{"rendered":"\n<p>\u6bcf\u4e2aObject\u90fd\u6709\u81ea\u5df1\u7684\u5750\u6807\u7cfb\u7edf\uff0c\u628a\u8fd9\u4e2a\u7269\u4f53\u653e\u5728\u4e16\u754c\u5750\u6807\u7cfb\u7edf\u540e\uff0c\u5bf9Object\u6267\u884c\u53d8\u6362\u64cd\u4f5c\uff0c\u672c\u8d28\u4e0a\u662f\u5728\u53d8\u6362\u5b83\u7684\u5750\u6807\u7cfb\uff0c\u800c\u4e0d\u662f\u6539\u53d8\u7269\u4f53\u4e0a\u7684\u70b9\u7ebf\u9762\u7684\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<p>Transform2D\u7684\u7ed3\u6784\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n\n\n\n<p>$$\\begin{bmatrix} basis.x.x &amp; basis.y.x &amp; origin.x \\\\ basis.x.y &amp; basis.y.y &amp; origin.y \\end{bmatrix}$$<\/p>\n\n\n\n<p>\u5982\u679c\u6211\u6267\u884c\u65cb\u8f6c\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u672c\u8eab\u662f\u7ed9\u67d0\u4e2a\u70b9\u6267\u884c\u5de6\u4e58\u65cb\u8f6c\u77e9\u9635\uff0c\u65cb\u8f6c\u77e9\u9635\u7684\u957f\u8fd9\u6837\uff1a<\/p>\n\n\n\n<p>$$<br>R(\u03b8) =<br>\\begin{bmatrix}<br>\\cos\u03b8 &amp; -\\sin\u03b8 \\\\<br>\\sin\u03b8 &amp; \\cos\u03b8<br>\\end{bmatrix}<br>$$<\/p>\n\n\n\n<p>\u5165\u80a1\u54e6\u6211\u4eec\u6709\u4e00\u4e2a2D\u7684\u70b9\u6216\u8005\u4e00\u4e2aVector:<\/p>\n\n\n\n<p>$$ v = \\begin{bmatrix} x \\\\ y \\end{bmatrix}$$<\/p>\n\n\n\n<p>\u65cb\u8f6c\u77e9\u9635\u6267\u884c\u77e9\u9635\u4e58\u6cd5\u540e\u662f\uff1a<\/p>\n\n\n\n<p>$$v&#8217; = R(\u03b8) \\times v =<br>\\begin{bmatrix}<br>\\cos\u03b8 &amp; -\\sin\u03b8 \\\\<br>\\sin\u03b8 &amp; \\cos\u03b8<br>\\end{bmatrix}<br>\\begin{bmatrix}<br>x \\\\<br>y \\end{bmatrix} = \\begin{bmatrix}<br>x\\cos\u03b8 &#8211; y\\sin\u03b8 \\\\<br>x\\sin\u03b8 + y\\cos\u03b8<br>\\end{bmatrix}$$<\/p>\n\n\n\n<p>\u5e73\u79fb\uff1a<\/p>\n\n\n\n<p>\u56e0\u4e3a\u5e73\u79fb\u64cd\u4f5c\u65e0\u6cd5\u901a\u8fc72&#215;2\u77e9\u9635\u7684\u7ebf\u6027\u8ba1\u7b97\u83b7\u5f97\uff0c\u672c\u8d28\u4e0a\u662f\u52a0\u4e00\u4e2a\u504f\u79fb\u91cf\uff0c\u6240\u4ee5\u5728\u8ba1\u7b97\u673a\u56fe\u5f62\u4e2d\u4f7f\u7528Homogeneous coordinates,\u5c06\u4e00\u4e2a2D\u7684\u70b9\/Vector\u6269\u5c55\u62103\u7ef4\u7684\u5411\u91cf\uff1a<\/p>\n\n\n\n<p>$$P_{h} = \\begin{bmatrix} x \\\\ y \\\\ 1 \\end{bmatrix}$$<\/p>\n\n\n\n<p>\u6b64\u65f6\u7684transformations\u53d8\u62103&#215;3\u7684\u77e9\u9635\uff0c\u6bd4\u5982\u8981\u6267\u884c\u5e73\u79fb\u64cd\u4f5c(translation)\u5c06\u6240\u6709\u70b9\u5e73\u79fb$(t_x, t_y)$\uff0c\u6570\u5b66\u8868\u8fbe\uff1a<\/p>\n\n\n\n<p>$$\\begin{bmatrix} x&#8217; \\\\ y&#8217; \\end{bmatrix} = \\begin{bmatrix} x&#8217;+t_x \\\\ y&#8217; + t_y \\end{bmatrix}$$<\/p>\n\n\n\n<p>\u5728Hogogeneous coordinates\u7684\u5e73\u79fb\u77e9\u9635\u662f<\/p>\n\n\n\n<p>$$T(t_x, t_y) = \\begin{bmatrix} 1 &amp; 0 &amp; t_x \\\\ 0 &amp; 1 &amp; t_y \\\\ 0 &amp; 0 &amp; 1 \\end{bmatrix}$$<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u4e2aObject\u90fd\u6709\u81ea\u5df1\u7684\u5750\u6807\u7cfb\u7edf\uff0c\u628a\u8fd9\u4e2a\u7269\u4f53\u653e\u5728\u4e16\u754c\u5750\u6807\u7cfb\u7edf\u540e\uff0c\u5bf9Object\u6267\u884c\u53d8\u6362\u64cd\u4f5c\uff0c\u672c\u8d28\u4e0a\u662f\u5728\u53d8\u6362\u5b83\u7684\u5750\u6807\u7cfb\uff0c\u800c\u4e0d\u662f\u6539\u53d8\u7269\u4f53\u4e0a\u7684\u70b9\u7ebf\u9762\u7684\u4f4d\u7f6e\u3002 Transform2D\u7684\u7ed3\u6784\u662f\u8fd9\u6837\u7684\uff1a $$\\begin{bmatrix} basis.x.x &amp; basis.y.x &amp; origin.x \\\\ basis.x.y &amp; basis.y.y &amp; origin.y \\end{bmatrix}$$ \u5982\u679c\u6211\u6267\u884c\u65cb\u8f6c\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u672c\u8eab\u662f\u7ed9\u67d0\u4e2a\u70b9\u6267\u884c\u5de6\u4e58\u65cb\u8f6c\u77e9\u9635\uff0c\u65cb\u8f6c\u77e9\u9635\u7684\u957f\u8fd9\u6837\uff1a $$R(\u03b8) =\\begin{bmatrix}\\cos\u03b8 &amp; -\\sin\u03b8 \\\\\\sin\u03b8 &amp; \\cos\u03b8\\end{bmatrix}$$ \u5165\u80a1\u54e6\u6211\u4eec\u6709\u4e00\u4e2a2D\u7684\u70b9\u6216\u8005\u4e00\u4e2aVector: $$ v = \\begin{bmatrix} [&hellip;]<\/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":["post-943","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/tensorzen.blog\/index.php?rest_route=\/wp\/v2\/posts\/943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tensorzen.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tensorzen.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tensorzen.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tensorzen.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=943"}],"version-history":[{"count":12,"href":"https:\/\/tensorzen.blog\/index.php?rest_route=\/wp\/v2\/posts\/943\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/tensorzen.blog\/index.php?rest_route=\/wp\/v2\/posts\/943\/revisions\/955"}],"wp:attachment":[{"href":"https:\/\/tensorzen.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tensorzen.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tensorzen.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}