{"id":2160,"date":"2021-10-05T20:30:00","date_gmt":"2021-10-05T11:30:00","guid":{"rendered":"https:\/\/sirius10.net\/blog\/wordpress\/?p=2160"},"modified":"2021-10-05T20:32:20","modified_gmt":"2021-10-05T11:32:20","slug":"post-2160","status":"publish","type":"post","link":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/10\/05\/2160\/","title":{"rendered":"SDL2 \u3067\u6955\u5186\u3092\u63cf\u304f"},"content":{"rendered":"\n<p>\u3000\u4eca\u5ea6\u306f\u6955\u5186\u5f62\u3092\u66f8\u3044\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u4e0b\u306e\u56f3\u306e\u3088\u3046\u306a\u6955\u5186\u5f62\u3092\u8003\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/xy_oval.png\" alt=\"\" class=\"wp-image-2161\" srcset=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/xy_oval.png 320w, https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/xy_oval-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><figcaption>\u6955\u5186<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u3000\u3053\u306e\u6955\u5186\u306e\u65b9\u7a0b\u5f0f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"138\" height=\"60\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/oval.png\" alt=\"\" class=\"wp-image-2162\"\/><figcaption>\u6955\u5186\u306e\u65b9\u7a0b\u5f0f<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u3000\u5186\u3068\u540c\u69d8\u306b\u3001x \u304b\u3089 y \u3092\u6c42\u3081\u308b\u3068\u4ee5\u4e0b\u306e\u8a08\u7b97\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"210\" height=\"67\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/oval_y.png\" alt=\"\" class=\"wp-image-2163\"\/><figcaption>x \u304b\u3089 y \u3092\u6c42\u3081\u308b<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u3000\u3053\u308c\u3092\u95a2\u6570\u306b\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted file\">void draw_oval(SDL_Renderer *renderer, int sx, int sy, int a, int b) {\n    int x, y, px, py;\n\n    for( x = -a; x &lt;= a; x++ ) {\n        y = sqrt(1.0 - (double)(x*x)\/(a*a))*b +0.5;\n        px = sx + x;\n        py = sy - y;\n        SDL_RenderDrawPoint(renderer, px, py);\n        py = sy + y;\n        SDL_RenderDrawPoint(renderer, px, py);\n    }\n    for( y = -b; y &lt;= b; y++ ) {\n        x = sqrt(1.0 - (double)(y*y)\/(b*b))*a +0.5;\n        px = sx + x;\n        py = sy - y;\n        SDL_RenderDrawPoint(renderer, px, py);\n        px = sx - x;\n        SDL_RenderDrawPoint(renderer, px, py);\n    }\n}<\/pre>\n\n\n\n<p>\u3000\u3053\u306e\u95a2\u6570\u3092\u4f7f\u3044\u3001\u6955\u5186\u3092\u63cf\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002a \u3068 b \u304c \u7b49\u3057\u3051\u308c\u3070\u5186\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/oval-1.png\" alt=\"\" class=\"wp-image-2164\" srcset=\"https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/oval-1.png 320w, https:\/\/sirius10.net\/blog\/wordpress\/wp-content\/uploads\/2021\/10\/oval-1-300x225.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><figcaption>\u6955\u5186\u306e\u63cf\u753b<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u3000\u6b21\u306f\u3053\u306e\u6955\u5186\u3092\u56de\u8ee2\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u4eca\u5ea6\u306f\u6955\u5186\u5f62\u3092\u66f8\u3044\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u3000\u4e0b\u306e\u56f3\u306e\u3088\u3046\u306a\u6955\u5186\u5f62\u3092\u8003\u3048\u307e\u3059\u3002 \u3000\u3053\u306e\u6955\u5186\u306e\u65b9\u7a0b\u5f0f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u3000\u5186\u3068\u540c\u69d8\u306b\u3001x \u304b\u3089 y \u3092\u6c42\u3081\u308b\u3068\u4ee5\u4e0b\u306e\u8a08\u7b97\u306b\u306a\u308a\u307e\u3059\u3002 \u3000\u3053\u308c\u3092\u95a2\u6570\u306b\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-2160","post","type-post","status-publish","format-standard","hentry","category-sdl2"],"_links":{"self":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=2160"}],"version-history":[{"count":3,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2160\/revisions"}],"predecessor-version":[{"id":2199,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2160\/revisions\/2199"}],"wp:attachment":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=2160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=2160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=2160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}