{"id":56,"date":"2025-04-26T11:26:27","date_gmt":"2025-04-26T11:26:27","guid":{"rendered":"https:\/\/fukusei.vn\/?page_id=56"},"modified":"2025-04-26T11:26:27","modified_gmt":"2025-04-26T11:26:27","slug":"tinht-toa-toa-do-goc","status":"publish","type":"page","link":"https:\/\/fukusei.vn\/index.php\/tinht-toa-toa-do-goc\/","title":{"rendered":"t\u00ednht t\u00f3a t\u1ecda \u0111\u1ed9 g\u1ed1c"},"content":{"rendered":"\n<p><!DOCTYPE html><br \/>\n<html lang=\"vi\"><br \/>\n<head><br \/>\n  <meta charset=\"UTF-8\"><br \/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><br \/>\n  <title>T\u00ednh G\u1ed1c M\u1edbi<\/title><\/p>\n<style>\n    body {<br \/>\n      font-family: Arial, sans-serif;<br \/>\n      max-width: 600px;<br \/>\n      margin: auto;<br \/>\n      padding: 20px;<br \/>\n    }<br \/>\n    label {<br \/>\n      font-weight: bold;<br \/>\n      display: block;<br \/>\n      margin-top: 15px;<br \/>\n    }<br \/>\n    input {<br \/>\n      width: 45%;<br \/>\n      padding: 10px;<br \/>\n      margin: 5px 2% 10px 0;<br \/>\n      font-size: 16px;<br \/>\n    }<br \/>\n    button {<br \/>\n      padding: 10px 15px;<br \/>\n      font-size: 16px;<br \/>\n      margin-top: 15px;<br \/>\n    }<br \/>\n    pre {<br \/>\n      background-color: #f1f1f1;<br \/>\n      padding: 12px;<br \/>\n      margin-top: 20px;<br \/>\n      white-space: pre-wrap;<br \/>\n      border-radius: 5px;<br \/>\n    }<br \/>\n  <\/style>\n<p><\/head><br \/>\n<body><\/p>\n<h2>T\u00ednh T\u1ecda \u0110\u1ed9 G\u1ed1c M\u1edbi<\/h2>\n<p>  <label>T\u1ecda \u0111\u1ed9 g\u1ed1c (X, Y):<\/label><br \/>\n  <input type=\"number\" id=\"originX\" step=\"any\" placeholder=\"X g\u1ed1c\"><br \/>\n  <input type=\"number\" id=\"originY\" step=\"any\" placeholder=\"Y g\u1ed1c\"><\/p>\n<p>  <label>T\u1ecda \u0111\u1ed9 tr\u00ean PCB (X, Y):<\/label><br \/>\n  <input type=\"number\" id=\"pcbX\" step=\"any\" placeholder=\"X PCB\"><br \/>\n  <input type=\"number\" id=\"pcbY\" step=\"any\" placeholder=\"Y PCB\"><\/p>\n<p>  <label>T\u1ecda \u0111\u1ed9 th\u1ef1c t\u1ebf (X, Y):<\/label><br \/>\n  <input type=\"number\" id=\"realX\" step=\"any\" placeholder=\"X th\u1ef1c t\u1ebf\"><br \/>\n  <input type=\"number\" id=\"realY\" step=\"any\" placeholder=\"Y th\u1ef1c t\u1ebf\"><\/p>\n<p>  <button onclick=\"calculateNewOrigin()\">T\u00ednh G\u1ed1c M\u1edbi<\/button><\/p>\n<pre id=\"result\">Ch\u01b0a c\u00f3 k\u1ebft qu\u1ea3.<\/pre>\n<p>  <script><br \/>\n    function calculateNewOrigin() {<br \/>\n      const ox = parseFloat(document.getElementById(\"originX\").value);<br \/>\n      const oy = parseFloat(document.getElementById(\"originY\").value);<br \/>\n      const px = parseFloat(document.getElementById(\"pcbX\").value);<br \/>\n      const py = parseFloat(document.getElementById(\"pcbY\").value);<br \/>\n      const rx = parseFloat(document.getElementById(\"realX\").value);<br \/>\n      const ry = parseFloat(document.getElementById(\"realY\").value);<\/p>\n<p>      if ([ox, oy, px, py, rx, ry].some(isNaN)) {<br \/>\n        document.getElementById(\"result\").textContent = \"\u26a0\ufe0f Vui l\u00f2ng nh\u1eadp \u0111\u1ea7y \u0111\u1ee7 c\u00e1c t\u1ecda \u0111\u1ed9.\";<br \/>\n        return;<br \/>\n      }<\/p>\n<p>      const deltaX = rx - px;<br \/>\n      const deltaY = ry - py;<\/p>\n<p>      const newOriginX = ox + deltaX;<br \/>\n      const newOriginY = oy + deltaY;<\/p>\n<p>      const result =<br \/>\n        `\u27a1\ufe0f K\u1ebft qu\u1ea3:\\n` +<br \/>\n        `Delta X = ${rx} - ${px} = ${deltaX.toFixed(3)}\\n` +<br \/>\n        `Delta Y = ${ry} - ${py} = ${deltaY.toFixed(3)}\\n\\n` +<br \/>\n        `G\u1ed1c m\u1edbi X = ${ox} + ${deltaX.toFixed(3)} = ${newOriginX.toFixed(3)}\\n` +<br \/>\n        `G\u1ed1c m\u1edbi Y = ${oy} + ${deltaY.toFixed(3)} = ${newOriginY.toFixed(3)}\\n\\n` +<br \/>\n        `\u2705 G\u1ed1c m\u1edbi: (${newOriginX.toFixed(3)}, ${newOriginY.toFixed(3)})`;<\/p>\n<p>      document.getElementById(\"result\").textContent = result;<br \/>\n    }<br \/>\n  <\/script><br \/>\n<\/body><br \/>\n<\/html><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>T\u00ednh G\u1ed1c M\u1edbi T\u00ednh T\u1ecda \u0110\u1ed9 G\u1ed1c M\u1edbi T\u1ecda \u0111\u1ed9 g\u1ed1c (X, Y): T\u1ecda \u0111\u1ed9 tr\u00ean PCB (X, Y): T\u1ecda \u0111\u1ed9 th\u1ef1c t\u1ebf (X, Y): T\u00ednh G\u1ed1c M\u1edbi Ch\u01b0a c\u00f3 k\u1ebft qu\u1ea3.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-56","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/pages\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":1,"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/pages\/56\/revisions"}],"predecessor-version":[{"id":57,"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/pages\/56\/revisions\/57"}],"wp:attachment":[{"href":"https:\/\/fukusei.vn\/index.php\/wp-json\/wp\/v2\/media?parent=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}