{"id":14610,"date":"2019-08-05T09:00:12","date_gmt":"2019-08-05T00:00:12","guid":{"rendered":"https:\/\/www.agent-grow.com\/self20percent\/?p=14610"},"modified":"2019-08-01T12:52:30","modified_gmt":"2019-08-01T03:52:30","slug":"javascript-physics-animation-1","status":"publish","type":"post","link":"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/","title":{"rendered":"Web \u3067\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u30fb\u305d\u306e1 \u300ccanvas \u3067\u7d75\u3092\u63cf\u3044\u3066\u307f\u3088\u3046\u300d"},"content":{"rendered":"<h1>\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01<\/h1>\n<p>\u6700\u8fd1\u3001\u52d5\u304d\u304c\u3042\u308b Web \u30da\u30fc\u30b8\u304c\u591a\u304f\u306a\u308a\u307e\u3057\u305f\u306d\u3002<br \/>\n\u3053\u3053\u6570\u5e74\u3067 Web \u306f\u5927\u5206\u9032\u5316\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u3067\u306f\u5358\u7d14\u306b\u52d5\u304f\u3060\u3051\u306e\u30da\u30fc\u30b8\u3060\u3051\u3067\u306f\u306a\u304f\u3001 Web \u30da\u30fc\u30b8\u3067\u672c\u683c\u7684\u306a\u30b2\u30fc\u30e0\u304c\u3067\u304d\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>Web \u3067\u30b2\u30fc\u30e0\u3001\u81ea\u5206\u3067\u3082\u4f5c\u3063\u3066\u307f\u305f\u3044\u3067\u3059\u3088\u306d\uff1f<\/p>\n<p>\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u5834\u5408\u306b\u5927\u5207\u306b\u306a\u308b\u306e\u304c\u300c\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u300d\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u305d\u3093\u306a\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u4e2d\u3067\u3082\u3001<br \/>\n\u300c\u7269\u7406\u300d\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306b\u30af\u30ed\u30fc\u30b9\u30a2\u30c3\u30d7\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u4eca\u56de\u306f\u7d9a\u304d\u7269\u3067\u66f8\u3053\u3046\u304b\u306a\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u6700\u5f8c\u306b\u5bbf\u984c\u3082\u51fa\u3057\u307e\u3059\u306e\u3067\u3001\u662f\u975e\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<br \/>\n\uff08\u56de\u7b54\u306f\u6b21\u56de\u306e\u5192\u982d\u306b\u8a18\u8f09\u3057\u307e\u3059\uff09<\/p>\n<h1>\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3068\u306f\uff1f<\/h1>\n<p>\u307e\u305a\u3001\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3068\u306f\u3069\u3093\u306a\u3082\u306e\u304b\uff1f\u3068\u8a00\u3046\u3053\u3068\u306a\u306e\u3067\u3059\u304c\u2026<br \/>\n\u305d\u306e\u307e\u307e\u3001\u7269\u8cea\u304c\u7269\u7406\u8a08\u7b97\u306b\u5f93\u3063\u3066\u52d5\u3044\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3068\u306f\u8a00\u3063\u3066\u3082\u3001\u6b63\u78ba\u306b\u306f\u305d\u3093\u306a\u8a00\u8449\u304c\u5b58\u5728\u3059\u308b\u304b\u306f\u5206\u304b\u308a\u307e\u305b\u3093\u304c\u2026<br \/>\n\u4e00\u65e6\u3053\u3053\u3067\u306f\u3001\u305d\u3046\u3044\u3046\u5b9a\u7fa9\u3060\u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u3093\u306a\u3082\u306e\u304c\u4f55\u306e\u5f79\u306b\u7acb\u3064\u306e\u304b\uff1f\u3068\u304a\u601d\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u78ba\u304b\u306b\u7814\u7a76\u8005\u304c\u3001\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u4e0a\u3067\u5b9f\u9a13\u3059\u308b\u3068\u304d\u306b\u305d\u3093\u306a\u3053\u3068\u3092\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u306f\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u2026<\/p>\n<p>\u610f\u5916\u306b\u8eab\u8fd1\u306a\u3068\u3053\u308d\u3067\u3001\u7686\u3055\u3093\u304c\u3088\u304f\u77e5\u3063\u3066\u3044\u308b\u30c6\u30ec\u30d3\u30b2\u30fc\u30e0\u3082<br \/>\n\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u96c6\u5408\u4f53\u3068\u8a00\u3063\u3066\u3082\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u304c\u30b8\u30e3\u30f3\u30d7\u3059\u308b\u52d5\u4f5c\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4f55\u306e\u5909\u54f2\u3082\u7121\u3044\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u3088\u3046\u3067\u3059\u304c\u3001<br \/>\n\u305f\u3044\u3066\u3044\u306e\u5834\u5408\u306f\u304d\u3061\u3093\u3068\u30b8\u30e3\u30f3\u30d7\u3057\u305f\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306f\u5730\u9762\u306b\u623b\u3063\u3066\u304d\u307e\u3059\u3088\u306d\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u304c\u5730\u9762\u306b\u623b\u3063\u3066\u304f\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3059\u306a\u308f\u3061\u3001<br \/>\n\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306b\u5bfe\u3057\u3066\u91cd\u529b\u304c\u304b\u304b\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u5f53\u305f\u308a\u524d\u306e\u3053\u3068\u306e\u3088\u3046\u306b\u611f\u3058\u307e\u3059\u304c\u3001\u30b8\u30e3\u30f3\u30d7\u4e00\u3064\u3068\u3063\u3066\u307f\u3066\u3082<\/p>\n<ul>\n<li>\u30b8\u30e3\u30f3\u30d7\u3057\u305f\u3068\u304d\u306e\u8db3\u306e\u529b\u3092\u8003\u3048\u3066\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u4e0a\u306b\u98db\u3070\u3057<\/li>\n<li>\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u91cd\u91cf\u3092\u8003\u616e\u3057\u3066\u91cd\u529b\u3092\u304b\u3051\u3001\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u304c\u9014\u4e2d\u304b\u3089\u843d\u4e0b\u3059\u308b\u3088\u3046\u306b\u3057<\/li>\n<li>\u5730\u9762\u307e\u3067\u623b\u3063\u3066\u304d\u305f\u3089\u3001\u305d\u308c\u4ee5\u4e0a\u843d\u4e0b\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>\u3056\u3063\u304f\u308a\u8003\u3048\u3066\u3082\u3053\u3093\u306a\u51e6\u7406\u304c\u5185\u90e8\u3067\u306f\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3093\u3067\u3059\u306d\u3002<\/p>\n<h1>\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u3084\u308b\u524d\u306b &#8211; \u753b\u9762\u306b\u63cf\u753b\u3059\u308b\u65b9\u6cd5\u3092\u899a\u3048\u3088\u3046<\/h1>\n<p>\u3055\u3066\u3001\u65e9\u901f\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u2026\u3068\u8a00\u3044\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001<br \/>\n\u307e\u305a\u305d\u306e\u524d\u306b\u3001\u753b\u9762\u306b\u7d75\u3092\u63cf\u304f\u65b9\u6cd5\u304c\u5206\u304b\u3089\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u307e\u305a\u3001\u753b\u9762\u4e0a\u306b\u7d75\u3092\u63cf\u304f\u65b9\u6cd5\u304b\u3089\u5b66\u3093\u3067\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>canvas \u306e\u6e96\u5099<\/h2>\n<p>\u4eca\u56de\u306f Web \u4e0a\u3067\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308a\u305f\u3044\u306e\u3067\u3001<br \/>\n\u3082\u3061\u308d\u3093\u30d6\u30e9\u30a6\u30b6\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u7d75\u3092\u63cf\u304f\u306b\u306f\u3001 canvas \u8981\u7d20\u304c\u4f7f\u3048\u307e\u3059\u306d\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u753b\u9762\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u2026<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\uff1c!DOCTYPE html\uff1e\n\uff1chtml\uff1e\n\uff1chead\uff1e\n  \uff1cmeta charset=\u201dutf-8\u201d\uff1e\n  \uff1ctitle\uff1eCanvas Test\uff1c\/title\uff1e\n\uff1c\/head\uff1e\n\uff1cbody\uff1e\n  \uff1ccanvas\n    id=\u201dcanvas\u201d\n    width=\u201d640\u201d\n    height=\u201d480\u201d\n    style=\u201d\n      border: solid 1px #000000;\n      box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);\n      border-radius: 3px;\u201d\n  \uff1e\uff1c\/canvas\uff1e\n  \uff1cscript src=\u201d.\/index.js\u201d\uff1e\uff1c\/script\uff1e\n\uff1c\/body\uff1e\n\uff1c\/html\uff1e\n<\/pre>\n<p>canvas \u306f\u521d\u671f\u72b6\u614b\u3067\u306f\u771f\u3063\u767d\u306a\u306e\u3067\u3001<br \/>\n\u67a0\u7dda\u3092\u3064\u3051\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u73fe\u6642\u70b9\u3067\u753b\u9762\u306f\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14616\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/%e7%84%a1%e9%a1%8c-78\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-3.png\" data-orig-size=\"800,663\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-3.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-3-300x249.png\" alt=\"\" width=\"300\" height=\"249\" class=\"alignnone size-medium wp-image-14616\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-3-300x249.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-3-768x636.png 768w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-3.png 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><code>index.html<\/code> \u3068\u540c\u3058\u6240\u306b <code>index.js<\/code> \u30d5\u30a1\u30a4\u30eb\u3082\u8a2d\u7f6e\u3057\u3066\u304a\u3051\u3070\u3001<br \/>\n\u305d\u3053\u304b\u3089 JavaScript \u3092\u8aad\u307f\u8fbc\u3093\u3067\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>canvas \u306b\u56f3\u5f62\u3092\u63cf\u753b\u3057\u3066\u307f\u308b<\/h2>\n<p>\u3068\u308a\u3042\u3048\u305a canvas \u306f\u7528\u610f\u3067\u304d\u305f\u306e\u3067\u3001\u5b9f\u969b\u306b\u3053\u3053\u306b\u7c21\u5358\u306a\u56f3\u5f62\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u4e00\u5fdc\u753b\u50cf\u306a\u3093\u304b\u3082\u8aad\u307f\u8fbc\u3093\u3067\u8868\u793a\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u304c\u3001<br \/>\n\u4eca\u56de\u306f\u6700\u7d42\u7684\u306b\u3084\u308a\u305f\u3044\u306e\u306f\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306a\u306e\u3067<br \/>\n\u56f3\u5f62\u306e\u63cf\u753b\u306e\u307f\u3084\u308a\u307e\u3059\u3002<\/p>\n<p>\u9577\u65b9\u5f62\u3092\u66f8\u304f\u306e\u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst main = () =\uff1e {\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u8981\u7d20\u306e\u53d6\u5f97\n  const canvas = document.getElementById(\u201dcanvas\u2019);\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u3092\u64cd\u4f5c\u3059\u308b API \u3092\u53d6\u5f97\n  const ctx = canvas.getContext(\u20192d\u2019);\n\n  \/\/ \u9577\u65b9\u5f62\u3092\u63cf\u753b\u3059\u308b\n  \/\/ \u7dda\u3092\u5f15\u304f\u4f5c\u696d\u3092\u958b\u59cb\n  ctx.beginPath();\n\n  \/\/ \u5ea7\u6a19 30, 30 \u3078\u79fb\u52d5\n  ctx.moveTo(30, 30);\n  \/\/ \u5ea7\u6a19 30, 120 \u307e\u3067\u76f4\u7dda\u3092\u5f15\u304f\n  ctx.lineTo(30, 120);\n  \/\/ \u5ea7\u6a19 360, 120 \u307e\u3067\u76f4\u7dda\u3092\u5f15\u304f\n  ctx.lineTo(360, 120);\n  \/\/ \u5ea7\u6a19 360, 30 \u307e\u3067\u76f4\u7dda\u3092\u5f15\u304f\n  ctx.lineTo(360, 30);\n\n  \/\/ \u958b\u59cb\u5730\u70b9\u306b\u623b\u3063\u3066\u7dda\u3092\u9589\u3058\u308b\n  ctx.closePath();\n\n  \/\/ \u5f15\u3044\u305f\u7dda\u306e\u5185\u5074\u3092\u5857\u308a\u3064\u3076\u3059\n  ctx.fill();\n};\n\ndocument.addEventListener(\u2019DOMContentLoaded\u2019, main);\n<\/pre>\n<p>\u5148\u306b\u3053\u308c\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092\u304a\u898b\u305b\u3059\u308b\u3068\u3001\u3053\u3093\u306a\u304b\u3093\u3058\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14618\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/%e7%84%a1%e9%a1%8c-79\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-4.png\" data-orig-size=\"796,663\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-4.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-4-300x250.png\" alt=\"\" width=\"300\" height=\"250\" class=\"alignnone size-medium wp-image-14618\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-4-300x250.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-4-768x640.png 768w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-4.png 796w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u5b9f\u969b\u306e\u51e6\u7406\u306e\u89e3\u8aac\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>\u4e00\u756a\u4e0b\u306e <code>addEventListener<\/code> \u306f\u3001\u753b\u9762\u306e\u6e96\u5099\u304c\u3067\u304d\u305f\u3089 <code>main<\/code> \u306e\u95a2\u6570\u3092\u5b9f\u884c\u3057\u3066\u306d\u3001<br \/>\n\u3068\u3044\u3046\u3060\u3051\u306e\u5185\u5bb9\u306a\u306e\u3067\u826f\u3044\u3068\u3057\u3066\u3001\u5b9f\u969b\u306b <code>main<\/code> \u306e\u95a2\u6570\u306e\u4e2d\u8eab\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u8981\u7d20\u306e\u53d6\u5f97\n  const canvas = document.getElementById(\u2019canvas\u2019);\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u3092\u64cd\u4f5c\u3059\u308b API \u3092\u53d6\u5f97\n  const ctx = canvas.getContext(\u20192d\u2019);\n<\/pre>\n<p>\u307e\u305a\u3001html \u306e\u65b9\u3067\u4f5c\u6210\u3057\u305f canvas \u3092\u53d6\u5f97\u3057\u3066\u304d\u307e\u3059\u3002<br \/>\ncanvas \u8981\u7d20\u306f\u3001\u63cf\u753b\u5185\u5bb9\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e API \u3092\u6301\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001<br \/>\n\u305d\u308c\u3092 <code>getContext(\u20192d\u2019)<\/code> \u3067\u53d6\u5f97\u3057\u3066 <code>ctx<\/code> \u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u3093\u3068\u306a\u304f\u304a\u6c17\u3065\u304d\u306e\u65b9\u3082\u3044\u3089\u3063\u3057\u3083\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001 <code>2d<\/code> \u3068\u3042\u308b\u306e\u3067\u3001<br \/>\n\u5e73\u9762\u7684\u306b\u63cf\u753b\u3059\u308b\u305f\u3081\u306e API \u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u306f <code>3d<\/code> \u3068\u3084\u308c\u3070\u7acb\u4f53\u7684\u306a\u7d75\u304c\u63cf\u3051\u308b\u306e\u304b\u2026\uff1f\u3068\u3044\u3046\u3068\u3001<br \/>\n\u307e\u3060\u305d\u3053\u307e\u3067\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\uff08\u5c06\u6765\u7684\u306b\u306f\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3067\u3059\u306d\uff01\uff09<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u3053\u306e\u5f8c\u306f ctx \u306b\u5bfe\u3057\u3066\u64cd\u4f5c\u3059\u308b\u3053\u3068\u3067\u3001<br \/>\ncanvas \u306e\u63cf\u753b\u5185\u5bb9\u3092\u66f4\u65b0\u3057\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u9577\u65b9\u5f62\u3092\u63cf\u753b\u3059\u308b\n  \/\/ \u7dda\u3092\u5f15\u304f\u4f5c\u696d\u3092\u958b\u59cb\n  ctx.beginPath();\n<\/pre>\n<p>\u6b21\u306b\u3001\u7dda\u3092\u4eca\u304b\u3089\u5f15\u304d\u307e\u3059\u3088\u3068\u8a00\u3046\u547d\u4ee4\u3092\u51fa\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>canvas \u3067\u56f3\u5f62\u3092\u63cf\u753b\u3059\u308b\u969b\u306b\u306f\u3001\u6b21\u306b\u793a\u3059\u3088\u3046\u306b<br \/>\n\u3042\u308b\u5ea7\u6a19\u304b\u3089\u3042\u308b\u5ea7\u6a19\u307e\u3067\u7dda\u3092\u5f15\u304f\u3001\u306e\u3088\u3046\u306a\u65b9\u6cd5\u3067\u547d\u4ee4\u3092\u3057\u3066\u63cf\u753b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u5ea7\u6a19 30, 30 \u3078\u79fb\u52d5\n  ctx.moveTo(30, 30);\n  \/\/ \u5ea7\u6a19 30, 120 \u307e\u3067\u76f4\u7dda\u3092\u5f15\u304f\n  ctx.lineTo(30, 120);\n  \/\/ \u5ea7\u6a19 360, 120 \u307e\u3067\u76f4\u7dda\u3092\u5f15\u304f\n  ctx.lineTo(360, 120);\n  \/\/ \u5ea7\u6a19 360, 30 \u307e\u3067\u76f4\u7dda\u3092\u5f15\u304f\n  ctx.lineTo(360, 30);\n\n  \/\/ \u958b\u59cb\u5730\u70b9\u306b\u623b\u3063\u3066\u7dda\u3092\u9589\u3058\u308b\n  ctx.closePath();\n<\/pre>\n<p>\u30b3\u30e1\u30f3\u30c8\u306e\u3068\u304a\u308a\u3067\u3059\u304c\u3001\u7b46\u3092\u6307\u5b9a\u3055\u308c\u305f\u5ea7\u6a19\u3078\u6301\u3063\u3066\u884c\u3063\u3066\u3001<br \/>\n\u7dda\u3092\u66f8\u3044\u3066\u3044\u308b\u30a4\u30e1\u30fc\u30b8\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001web \u306e\u4e16\u754c\u3067\u306f\u5de6\u4e0a\u304c\u539f\u70b9\uff08\u3059\u306a\u308f\u3061\u5ea7\u6a19\u304c 0, 0\uff09\u3067\u3042\u308a\u3001<br \/>\n\u53f3\u65b9\u5411\u304c x \u5ea7\u6a19\u3001\u4e0b\u65b9\u5411\u304c y \u5ea7\u6a19\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14619\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/%e3%82%a2%e3%83%bc%e3%83%88%e3%83%9c%e3%83%bc%e3%83%89-1-72\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5.png\" data-orig-size=\"800,600\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u30a2\u30fc\u30c8\u30dc\u30fc\u30c9 1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5-300x225.png\" alt=\"\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-14619\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5-300x225.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5-768x576.png 768w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5-280x210.png 280w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5-150x112.png 150w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-5.png 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001\u5ea7\u6a19\u3092\u3068\u3063\u3066 1 \u304b\u3089\u9806\u306b\u7dda\u3092\u5f15\u3044\u3066\u3044\u304f\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u6700\u5f8c\u3001 <code>ctx.lineTo(30, 30);<\/code> \u3067\u306a\u304f <code>ctx.closePath();<\/code> \u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001<br \/>\n\u5f15\u3044\u305f\u7dda\u304c\u9589\u3058\u3066\u3044\u306a\u3044\u6642\u306f\u3001\u81ea\u52d5\u3067\u9589\u3058\u308b\u3088\u3046\u306b\u547d\u4ee4\u3067\u304d\u308b\u3093\u3067\u3059\u306d\u3002<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3001 <code>ctx.lineTo(30, 30);<\/code> \u3068\u66f8\u3044\u3066\u3082 OK\u3002\u610f\u5473\u7684\u306b\u306f\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3053\u3053\u307e\u3067\u5b9f\u884c\u3057\u3066\u307f\u3066\u3082\u3001\u753b\u9762\u4e0a\u306b\u306f\u4f55\u3082\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<br \/>\n\uff08\u6700\u5f8c\u306e ctx.fill(); \u3092\u6d88\u3057\u3066\u5b9f\u884c\u3057\u3066\u307f\u305f\u3089\u3001\u753b\u9762\u304c\u771f\u3063\u767d\u306e\u307e\u307e\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff09<\/p>\n<p>\u3053\u308c\u306f\u3001\u4e0a\u306e\u4f5c\u696d\u3067\u306f\u5b9f\u969b\u306b\u76ee\u306b\u898b\u3048\u308b\u7dda\u3092\u5f15\u3044\u305f\u308f\u3051\u3067\u306f\u306a\u304f\u3001<br \/>\n\u3053\u308c\u304b\u3089\u63cf\u753b\u3059\u308b\u300c\u7bc4\u56f2\u3092\u6307\u5b9a\u300d\u3057\u305f\u3060\u3051\u306a\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u5b9f\u969b\u306b\u9577\u65b9\u5f62\u304c\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u306b\u306f\u3001<br \/>\n\u305d\u306e\u7bc4\u56f2\u3092\u5857\u308a\u3064\u3076\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u5f15\u3044\u305f\u7dda\u306e\u5185\u5074\u3092\u5857\u308a\u3064\u3076\u3059\n  ctx.fill();\n<\/pre>\n<p>\u3053\u308c\u3067\u5857\u308a\u3064\u3076\u3057\u304c\u3067\u304d\u307e\u3057\u305f\uff01<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u6700\u521d\u306b\u304a\u898b\u305b\u3057\u305f\u3088\u3046\u306b\u9577\u65b9\u5f62\u304c\u63cf\u753b\u3055\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>\u3082\u3063\u3068\u7c21\u5358\u306b\u9577\u65b9\u5f62\u3092\u304b\u304f<\/h2>\n<p>\u4e0a\u306e\u64cd\u4f5c\u3067\u3001canvas \u4e0a\u3067\u306e\u63cf\u753b\u306e\u8003\u3048\u65b9\u306b\u3064\u3044\u3066\u5927\u4f53\u7406\u89e3\u3057\u3066\u3082\u3089\u3048\u305f\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305f\u3060\u3001\u9577\u65b9\u5f62\u306e\u3088\u3046\u306a\u3001\u63cf\u753b\u3059\u308b\u983b\u5ea6\u304c\u9ad8\u3044\u5358\u7d14\u306a\u56f3\u5f62\u306f\u3001<br \/>\n\u3082\u3046\u5c11\u3057\u7c21\u5358\u306b\u304b\u3051\u308b\u3068\u3044\u3044\u306e\u306b\u306a\u2026\u3068\u3044\u3046\u611f\u3058\u304c\u3057\u307e\u3059\u3088\u306d\u3002<\/p>\n<p>\u305d\u3046\u3067\u3059\u3002\u304d\u3061\u3093\u3068\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3088\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst main = () =\uff1e {\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u8981\u7d20\u306e\u53d6\u5f97\n  const canvas = document.getElementById(\u2019canvas\u2019);\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u3092\u64cd\u4f5c\u3059\u308b API \u3092\u53d6\u5f97\n  const ctx = canvas.getContext(\u20192d\u2019);\n\n  \/\/ \u9577\u65b9\u5f62\u3092\u63cf\u753b\u3059\u308b\n  \/\/ \u7dda\u3092\u5f15\u304f\u4f5c\u696d\u3092\u958b\u59cb\n  ctx.beginPath();\n\n  \/\/ \u9577\u65b9\u5f62\u3092\u63cf\u753b\u3059\u308b\n  ctx.fillRect(30, 30, 330, 90);\n};\n\ndocument.addEventListener(\u2019DOMContentLoaded\u2019, main);\n<\/pre>\n<p>\u3059\u3054\u304f\u77ed\u304f\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3067\u3082\u5148\u307b\u3069\u3068\u540c\u3058\u56f3\u5f62\u304c\u63cf\u753b\u3055\u308c\u307e\u3059\uff01<\/p>\n<p>\u30dd\u30a4\u30f3\u30c8\u306f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u9577\u65b9\u5f62\u3092\u63cf\u753b\u3059\u308b\n  ctx.fillRect(30, 30, 330, 90);\n<\/pre>\n<p>\u3053\u3053\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nctx.fillRect(x \u65b9\u5411\u306e\u958b\u59cb\u70b9, y \u65b9\u5411\u306e\u958b\u59cb\u70b9, x \u65b9\u5411\u306e\u9577\u3055, y \u65b9\u5411\u306e\u9577\u3055);\n<\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067\u3001\u5148\u307b\u3069\u9577\u3005\u3068\u66f8\u3044\u305f\u30d1\u30b9\u306e\u6307\u5b9a\u3092\u3057\u3066\u5857\u308a\u3064\u3076\u3057\u307e\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u306e\u3060\u304b\u3089\u3001\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<h2>\u5186\uff08\u5186\u5f27\uff09\u3082\u304b\u3051\u308b<\/h2>\n<p>\u5148\u307b\u3069\u306e\u30d1\u30b9\u306e\u6307\u5b9a\u65b9\u6cd5\u3060\u3068\u9577\u65b9\u5f62\u306e\u3088\u3046\u306a\u76f4\u7dda\u7684\u306a\u56f3\u5f62\u306f\u66f8\u3051\u307e\u3059\u304c\u3001<br \/>\n\u5186\u306e\u3088\u3046\u306a\u66f2\u7dda\u7684\u306a\u56f3\u5f62\u306f\u96e3\u3057\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u76f4\u7dda\u306e\u30d1\u30b9\u3068\u540c\u69d8\u3001\u66f2\u7dda\u306e\u30d1\u30b9\u3092\u63cf\u753b\u3059\u308b\u547d\u4ee4\u3082\u5b58\u5728\u3057\u307e\u3059\uff01<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst main = () =\uff1e {\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u8981\u7d20\u306e\u53d6\u5f97\n  const canvas = document.getElementById(\u2019canvas\u2019);\n  \/\/ \u30ad\u30e3\u30f3\u30d0\u30b9\u3092\u64cd\u4f5c\u3059\u308b API \u3092\u53d6\u5f97\n  const ctx = canvas.getContext(\u20192d\u2019);\n\n  \/\/ \u7dda\u3092\u5f15\u304f\u4f5c\u696d\u3092\u958b\u59cb\n  ctx.beginPath();\n\n  \/\/ \u5186\u306e\u30d1\u30b9\u3092\u4f5c\u6210\n  ctx.arc(120, 120, 40, 0, Math.PI * 2, true);\n\n  \/\/ \u5857\u308a\u3064\u3076\u3057\u306e\u8272\u3092\u6307\u5b9a\n  ctx.fillStyle = \u2019rgb(33, 150, 253)\u2019;\n\n  \/\/ \u5857\u308a\u3064\u3076\u3057\u3092\u5b9f\u884c\n  ctx.fill();\n};\n\ndocument.addEventListener(\u2019DOMContentLoaded\u2019, main);\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14687\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/%e7%84%a1%e9%a1%8c-80\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e.png\" data-orig-size=\"763,640\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-300x252.png\" alt=\"\" width=\"300\" height=\"252\" class=\"alignnone size-medium wp-image-14687\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-300x252.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e.png 763w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u5186\u306e\u30d1\u30b9\u3092\u4f5c\u3063\u3066\u3044\u308b\u306e\u306f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u5186\u306e\u30d1\u30b9\u3092\u4f5c\u6210\n  ctx.arc(120, 120, 40, 0, Math.PI * 2, true);\n<\/pre>\n<p>\u3053\u306e\u90e8\u5206\u3067\u3059\u306d\u3002<\/p>\n<p>\u5f15\u6570\u304c\u5c11\u3057\u8907\u96d1\u3067\u3059\u304c\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u5186\u306e\u30d1\u30b9\u3092\u4f5c\u6210\n  ctx.arc(x \u65b9\u5411\u306e\u5186\u5f27\u306e\u4e2d\u5fc3\u70b9, y \u65b9\u5411\u306e\u5186\u5f27\u306e\u4e2d\u5fc3\u70b9, \u534a\u5f84, \u958b\u59cb\u70b9, \u7d42\u4e86\u70b9, \u6642\u8a08\u56de\u308a or \u53cd\u6642\u8a08\u56de\u308a);\n<\/pre>\n<p>\u3053\u3053\u3067\u96e3\u3057\u3044\u306e\u306f <code>\u958b\u59cb\u70b9<\/code> \u3068 <code>\u7d42\u4e86\u70b9<\/code> \u3067\u3059\u306d\u3002<\/p>\n<p>\u5186\u306e\u3069\u3053\u306e\u90e8\u5206\u304b\u3089\u66f8\u304d\u59cb\u3081\u3066\u3001\u3069\u3053\u306e\u90e8\u5206\u3067\u7d42\u308f\u308b\u304b\u3001\u3068\u8a00\u3046\u6307\u5b9a\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u5186\u306a\u306e\u3067\u4e00\u9031\u3050\u308b\u3063\u3068\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3092\u3046\u307e\u304f\u8abf\u6574\u3059\u308b\u3053\u3068\u3067<br \/>\n\u534a\u5186\u306a\u3093\u304b\u3082\u3064\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u89d2\u5ea6\u306f\u30e9\u30b8\u30a2\u30f3\u306a\u306e\u3067\u3001 \u30d1\u30a4 <code>Math.PI<\/code> \u3092\u4f7f\u3063\u3066\u8a08\u7b97\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u8a73\u3057\u3044\u8aac\u660e\u306f\u7701\u304d\u307e\u3059\u304c\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u901a\u308a\u30d1\u30a4\u306e 2 \u500d\u3067\u4e00\u9031\u5206\u3067\u3059\u306d\u3002<br \/>\n2\u500d\u305b\u305a\u306b\u4f7f\u3063\u305f\u3089\u534a\u5186\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u5186\u306e\u30d1\u30b9\u3092\u4f5c\u6210\n  ctx.arc(120, 120, 40, 0, Math.PI, true);\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14688\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/%e7%84%a1%e9%a1%8c-81\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1.png\" data-orig-size=\"763,640\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1-300x252.png\" alt=\"\" width=\"300\" height=\"252\" class=\"alignnone size-medium wp-image-14688\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1-300x252.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1.png 763w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u6700\u5f8c\u306e <code>\u6642\u8a08\u56de\u308a or \u53cd\u6642\u8a08\u56de\u308a<\/code> \u306f\u3001 false \u3060\u3068\u53cd\u6642\u8a08\u56de\u308a\u3001 true \u3060\u3068\u6642\u8a08\u56de\u308a\u3067\u63cf\u753b\u3057\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u4e00\u9031\u66f8\u3044\u3066\u3044\u308b\u306e\u3067\u3069\u3061\u3089\u3067\u3082\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001\u4eca\u56de\u306f\u3061\u3087\u3063\u3068\u8272\u3082\u3064\u3051\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \/\/ \u5857\u308a\u3064\u3076\u3057\u306e\u8272\u3092\u6307\u5b9a\n  ctx.fillStyle = \u2019rgb(33, 150, 253)\u2019;\n<\/pre>\n<p>\u3069\u3093\u306a\u8272\u306b\u3059\u308b\u304b\u306f CSS \u3067\u306e\u8272\u6307\u5b9a\u3068\u540c\u3058\u306a\u306e\u3067\u3001<br \/>\n\u8272\u3005\u8abf\u3079\u305f\u3044\u65b9\u306f\u305d\u306e\u65b9\u5411\u3067\u8abf\u3079\u3066\u3082\u3089\u3063\u305f\u3089\u3088\u3044\u304b\u3068\u3002<\/p>\n<h1>\u5bbf\u984c<\/h1>\n<p>\u3055\u3066\u3001\u4eca\u56de\u306f canvas \u3067\u306e\u56f3\u5f62\u63cf\u753b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3057\u305f\u3002<br \/>\n\u7269\u7406\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3001\u3072\u3044\u3066\u306f\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u305f\u3081\u306b\u306f\u7d75\u304c\u63cf\u3051\u306a\u3051\u308c\u3070\u884c\u3051\u307e\u305b\u3093\u306e\u3067\u3001<br \/>\n\u307e\u305a\u306f\u56f3\u5f62\u3092\u66f8\u304f\u4f5c\u696d\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u4eca\u56de\u306e\u5bbf\u984c\u306f\u3053\u3061\u3089\u3002<\/p>\n<ul>\n<li>\u4e09\u89d2\u5f62\u3092\u4e00\u3064\u3001canvas \u4e0a\u306b\u63cf\u753b\u3057\u3066\u304f\u3060\u3055\u3044<\/li>\n<\/ul>\n<p>\u4eca\u5f8c\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u884c\u304f\u306b\u5f53\u305f\u3063\u3066\u3001\u4f7f\u3046\u306e\u306f\u5186\u306e\u63cf\u753b\u304c\u4e3b\u306b\u306a\u308a\u307e\u3059\u304c\u3001<br \/>\n\u3053\u3053\u306f\u4e00\u3064\u3001\u81ea\u5206\u3067\u30d1\u30b9\u3092\u4f5c\u3063\u3066\u63cf\u753b\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u304a\u3055\u3089\u3044\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>canvas \u4e0a\u3067\u306e\u63cf\u753b\u306e\u8003\u3048\u65b9\u3092\u3057\u3063\u304b\u308a\u3068\u628a\u63e1\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u306d\u3002<\/p>\n<p>\u4e00\u5fdc\u30d2\u30f3\u30c8\u3068\u3044\u3046\u304b\u3001\u8003\u3048\u65b9\u3082\u3002<\/p>\n<ol>\n<li>\u9577\u65b9\u5f62\u3084\u5186\u306f\u7c21\u5358\u306b\u304b\u3051\u307e\u3057\u305f\u304c\u3001\u4e09\u89d2\u5f62\u306f\u3069\u3061\u3089\u3067\u3082\u306a\u3044\u306e\u3067\u3001\u30d1\u30b9\u3092\u81ea\u5206\u3067\u4f5c\u3063\u3066\u63cf\u753b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e09\u89d2\u5f62\u3068\u8a00\u3048\u3070\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u60f3\u50cf\u3055\u308c\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14690\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/08\/05\/javascript-physics-animation-1\/%e7%84%a1%e9%a1%8c-82\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" data-orig-size=\"763,640\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-2-300x252.png\" alt=\"\" width=\"300\" height=\"252\" class=\"alignnone size-medium wp-image-14690\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-2-300x252.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/0d40a5e4a645fc6b96e767d64ac0878e-2.png 763w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n\u2026\u3067\u3059\u304c\u3001\u4e09\u89d2\u5f62\u306e\u5b9a\u7fa9\u306f\u3001\u3056\u3063\u304f\u308a\u8a00\u3048\u3070\u89d2\u304c\u4e09\u3064\u3042\u308c\u3070\u3044\u3044\u3067\u3059\u3002<br \/>\n\u89d2\u304c\u4e09\u3064\u3042\u308c\u3070\u3001\u3069\u3093\u306a\u5f62\u3067\u3082\u4e09\u89d2\u5f62\u3067\u3059\u306d\u3002<br \/>\n(\u3082\u3061\u308d\u3093\u3001\u81ea\u4fe1\u304c\u3042\u308b\u65b9\u306f\u4e0a\u306e\u753b\u50cf\u306e\u3088\u3046\u306a\u4e09\u89d2\u5f62\u3082\u66f8\u3044\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\uff01)<\/p>\n<\/li>\n<\/ol>\n<p>\u305d\u308c\u3067\u306f\u307e\u305f\u6b21\u56de\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01 \u6700\u8fd1\u3001\u52d5\u304d\u304c\u3042\u308b Web \u30da\u30fc\u30b8\u304c\u591a\u304f\u306a\u308a\u307e\u3057\u305f\u306d\u3002 \u3053\u3053\u6570\u5e74\u3067 Web \u306f\u5927\u5206\u9032\u5316\u3057\u307e\u3057\u305f\u3002 \u4eca\u3067\u306f\u5358\u7d14\u306b\u52d5\u304f\u3060\u3051\u306e\u30da\u30fc\u30b8\u3060\u3051\u3067\u306f\u306a\u304f\u3001 Web \u30da\u30fc\u30b8\u3067\u672c\u683c\u7684\u306a\u30b2\u30fc\u30e0\u304c\u3067\u304d\u305f\u308a\u3057\u307e\u3059\u3002 [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":14700,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[377,45,302],"class_list":["post-14610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-canvas","tag-javascript","tag-302"],"jetpack_featured_media_url":"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/08\/850c7612116999490846136e772ab7fd.png","jetpack_shortlink":"https:\/\/wp.me\/p7Bq4F-3NE","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts\/14610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/comments?post=14610"}],"version-history":[{"count":0,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts\/14610\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/media\/14700"}],"wp:attachment":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/media?parent=14610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/categories?post=14610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/tags?post=14610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}