{"id":10166,"date":"2023-02-15T21:00:00","date_gmt":"2023-02-15T12:00:00","guid":{"rendered":"https:\/\/taki-lab.site\/bocci\/?p=10166"},"modified":"2023-02-15T11:06:27","modified_gmt":"2023-02-15T02:06:27","slug":"%e3%80%90%e6%95%b0%e5%ad%a6%e3%80%91%e3%80%90python%e3%80%912%e3%81%a4%e3%81%ae%e3%83%99%e3%82%af%e3%83%88%e3%83%ab%e3%81%ae%e3%81%aa%e3%81%99%e8%a7%92%e5%ba%a6%e3%82%92%e6%b1%82%e3%82%81%e3%82%8b","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=10166","title":{"rendered":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u30112\u3064\u306e\u30d9\u30af\u30c8\u30eb\u306e\u306a\u3059\u89d2\u5ea6\u3092\u6c42\u3081\u308b\u3002"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-\u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f wp-block-embed-\u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"GpnOFGgmeT\"><a href=\"https:\/\/taki-lab.site\/bocci\/?p=10126\">\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u30d9\u30af\u30c8\u30eb\u306e\u6f14\u7b97<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u30d9\u30af\u30c8\u30eb\u306e\u6f14\u7b97&#8221; &#8212; \u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\" src=\"https:\/\/taki-lab.site\/bocci\/?p=10126&#038;embed=true#?secret=QaxsW1dmSR#?secret=GpnOFGgmeT\" data-secret=\"GpnOFGgmeT\" width=\"474\" height=\"267\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u3053\u306e\u516c\u5f0f\u3067\u6c42\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"230\" height=\"82\" data-attachment-id=\"10168\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=10168\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/c72c8dd6f7cdd55cd5cff5f03c2b0886.png?fit=230%2C82&amp;ssl=1\" data-orig-size=\"230,82\" 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=\"c72c8dd6f7cdd55cd5cff5f03c2b0886\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/c72c8dd6f7cdd55cd5cff5f03c2b0886.png?fit=230%2C82&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/c72c8dd6f7cdd55cd5cff5f03c2b0886.png?resize=230%2C82&#038;ssl=1\" alt=\"\" class=\"wp-image-10168\"\/><\/figure>\n\n\n\n<p>\u3053\u306e\u30b1\u30fc\u30b9\u3092\u89e3\u3044\u3066\u307f\u308b\u3068\u3001<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"371\" height=\"413\" data-attachment-id=\"10169\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=10169\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/6df66b262b1ccbc8a42146cf1e82ef62.png?fit=371%2C413&amp;ssl=1\" data-orig-size=\"371,413\" 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=\"6df66b262b1ccbc8a42146cf1e82ef62\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/6df66b262b1ccbc8a42146cf1e82ef62.png?fit=371%2C413&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/6df66b262b1ccbc8a42146cf1e82ef62.png?resize=371%2C413&#038;ssl=1\" alt=\"\" class=\"wp-image-10169\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/6df66b262b1ccbc8a42146cf1e82ef62.png?w=371&amp;ssl=1 371w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/02\/6df66b262b1ccbc8a42146cf1e82ef62.png?resize=269%2C300&amp;ssl=1 269w\" sizes=\"auto, (max-width: 371px) 100vw, 371px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>>>> import math\r\n>>> import numpy as np\r\n>>> a = np.array(&#91;2,7])\r\n>>> b = np.array(&#91;6,1])\r\n>>> c = np.array(&#91;2,3])\r\n>>> d = np.array(&#91;6,5])\r\n>>>\r\n>>> va = b - a\r\n>>> vb = d - c\r\n>>>\r\n>>> norm_a = np.linalg.norm(va)\r\n>>> norm_b = np.linalg.norm(vb)\r\n>>>\r\n>>> dot_ab = np.dot(va, vb)\r\n>>>\r\n>>> cos_th = dot_ab \/ (norm_a * norm_b)\r\n>>> rad = math.acos(cos_th)\r\n>>> deg = math.degrees(rad)\r\n>>> print(deg)\r\n82.8749836510982\r\n>>><\/code><\/pre>\n\n\n\n<p>\u5909\u6570a,b,c,d\u306f\u5404\u5ea7\u6a19\u306e\u5024\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>va,vb\u306f\u30d9\u30af\u30c8\u30eb\u306e\u6210\u5206\u3092\u8a08\u7b97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5f15\u304d\u7b97\u3067\u8a08\u7b97\u3067\u304d\u308b\u306e\u306f\u4fbf\u5229\u3002<\/p>\n\n\n\n<p>np.linalg.norm()\u3067\u30d9\u30af\u30c8\u30eb\u306e\u5927\u304d\u3055\u3092\u6c42\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30d9\u30af\u30c8\u30eb\u306e\u5404\u6210\u5206\u30922\u4e57\u3057\u305f\u548c\u306e\u5e73\u65b9\u6839\u3092\u8a08\u7b97\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>np.dot()\u306f\u30d9\u30af\u30c8\u30eb\u306e\u5185\u7a4d\u3092\u6c42\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>cos_th\u306b\u306f\u4e0a\u306e\u516c\u5f0f\u3092\u4f7f\u7528\u3057\u305f\u8a08\u7b97\u7d50\u679c\u304c\u5165\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092cos\u306e\u9006\u95a2\u6570\u3092\u8a08\u7b97\u3057\u3001\u30e9\u30b8\u30a2\u30f3\u3092\u89d2\u5ea6\u306b\u5909\u63db\u3059\u308b\u3068\u3001<\/p>\n\n\n\n<p>\u304a\u3088\u305d83\u5ea6\u3068\u3044\u3046\u8a08\u7b97\u7d50\u679c\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<a href=\"https:\/\/blog.with2.net\/link\/?id=2023426&#038;cid=9200\" title=\"\u65e5\u3005\u306e\u51fa\u6765\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\" target=\"_blank\" rel=\"noopener\"><image src=\"https:\/\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/11\/99c62cdd0038c9d3b540e561ee138b82-1.jpg\"><\/a>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u516c\u5f0f\u3067\u6c42\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u30b1\u30fc\u30b9\u3092\u89e3\u3044\u3066\u307f\u308b\u3068\u3001 \u5909\u6570a,b,c,d\u306f\u5404\u5ea7\u6a19\u306e\u5024\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 va,vb\u306f\u30d9\u30af\u30c8\u30eb\u306e\u6210\u5206\u3092\u8a08\u7b97\u3057\u3066\u3044\u307e\u3059\u3002 \u5f15\u304d\u7b97\u3067\u8a08\u7b97\u3067\u304d\u308b\u306e\u306f\u4fbf\u5229\u3002 np.linalg.norm()\u3067 &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=10166\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u3010\u6570\u5b66\u3011\u3010PYTHON\u30112\u3064\u306e\u30d9\u30af\u30c8\u30eb\u306e\u306a\u3059\u89d2\u5ea6\u3092\u6c42\u3081\u308b\u3002<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2806],"tags":[],"class_list":["post-10166","post","type-post","status-publish","format-standard","hentry","category-python"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8SDbY-2DY","jetpack-related-posts":[{"id":9415,"url":"https:\/\/taki-lab.site\/bocci\/?p=9415","url_meta":{"origin":10166,"position":0},"title":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u76f4\u89d2\u3092\u631f\u30802\u8fba\u306e\u6bd4\u304b\u3089\u89d2\u5ea6\u3092\u6c42\u3081\u308b","author":"taki","date":"2022\u5e7410\u670826\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9276 \u3053\u306e\u56f3\u306e\u03b8\u3092\u6c42\u3081\u307e\u3059\u3002 \u3053\u308c\u2026","rel":"","context":"Python","block_context":{"text":"Python","link":"https:\/\/taki-lab.site\/bocci\/?cat=2806"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/b95cd1b36e69e605eea8dda6e5996208.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":9158,"url":"https:\/\/taki-lab.site\/bocci\/?p=9158","url_meta":{"origin":10166,"position":1},"title":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u4e8c\u3064\u306e\u76f4\u7dda\u306e\u4ea4\u70b9\u3092\u6c42\u3081\u308b","author":"taki","date":"2022\u5e749\u670814\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9106 \u4e8c\u3064\u306e\u76f4\u7dda\u306e\u4ea4\u70b9\u3092\u6c42\u3081\u308b\u306b\u306f\u2026","rel":"","context":"Python","block_context":{"text":"Python","link":"https:\/\/taki-lab.site\/bocci\/?cat=2806"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9198,"url":"https:\/\/taki-lab.site\/bocci\/?p=9198","url_meta":{"origin":10166,"position":2},"title":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u5782\u76f4\u4e8c\u7b49\u5206\u7dda\u3092\u6c42\u3081\u308b","author":"taki","date":"2022\u5e749\u670822\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9158 \u3053\u308c\u307e\u3067\u3084\u3063\u3066\u304d\u305f\u3053\u3068\u3092\u4f7f\u3063\u2026","rel":"","context":"Python","block_context":{"text":"Python","link":"https:\/\/taki-lab.site\/bocci\/?cat=2806"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-19-103553.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-19-103553.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-19-103553.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-19-103553.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-19-103553.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":10582,"url":"https:\/\/taki-lab.site\/bocci\/?p=10582","url_meta":{"origin":10166,"position":3},"title":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u9006\u884c\u5217\u3092\u4f7f\u3063\u3066\u9023\u7acb\u65b9\u7a0b\u5f0f\u306e\u89e3\u3092\u6c42\u3081\u308b\u3002","author":"taki","date":"2023\u5e745\u670813\u65e5","format":false,"excerpt":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u884c\u5217\u306e\u9006\u884c\u5217\u3092\u6c42\u3081\u308b\u3002 | \u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f (taki-lab.s\u2026","rel":"","context":"Python","block_context":{"text":"Python","link":"https:\/\/taki-lab.site\/bocci\/?cat=2806"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/05\/image-2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":9106,"url":"https:\/\/taki-lab.site\/bocci\/?p=9106","url_meta":{"origin":10166,"position":4},"title":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u76f4\u7dda\u3068\u76f4\u4ea4\u3059\u308b\u76f4\u7dda\u3092\u6c42\u3081\u308b","author":"taki","date":"2022\u5e749\u67086\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9039 y=a1x+b\u3068y=a2x+\u2026","rel":"","context":"Python","block_context":{"text":"Python","link":"https:\/\/taki-lab.site\/bocci\/?cat=2806"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-04-123315.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-04-123315.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-04-123315.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-04-123315.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-04-123315.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":10070,"url":"https:\/\/taki-lab.site\/bocci\/?p=10070","url_meta":{"origin":10166,"position":5},"title":"\u3010\u6570\u5b66\u3011\u3010PYTHON\u3011\u30d9\u30af\u30c8\u30eb\u306e\u65b9\u5411\u3092\u6c42\u3081\u308b","author":"taki","date":"2023\u5e742\u67082\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9978 \u30d9\u30af\u30c8\u30eb\u304c\u793a\u3059\u5ea7\u6a19(x,y)\u2026","rel":"","context":"Python","block_context":{"text":"Python","link":"https:\/\/taki-lab.site\/bocci\/?cat=2806"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/01\/993e4d9533607bebf14169a859c40f8c.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/10166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10166"}],"version-history":[{"count":1,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/10166\/revisions"}],"predecessor-version":[{"id":10170,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/10166\/revisions\/10170"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}