{"id":11093,"date":"2021-05-01T15:11:31","date_gmt":"2021-05-01T06:11:31","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=11093"},"modified":"2021-05-03T16:43:05","modified_gmt":"2021-05-03T07:43:05","slug":"line-%ea%b7%b8%eb%a6%ac%ea%b8%b0-dda-%ec%95%8c%ea%b3%a0%eb%a6%ac%ec%a6%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=11093","title":{"rendered":"Line \uadf8\ub9ac\uae30 (DDA \uc54c\uace0\ub9ac\uc998)"},"content":{"rendered":"<p>C\uc5b8\uc5b4\ub85c \uad6c\ud604\ub41c \ucf54\ub4dc\ub97c C#\uc73c\ub85c \ubcc0\uacbd\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ucd9c\ucc98\ub294 https:\/\/www.geeksforgeeks.org\/dda-line-generation-algorithm-computer-graphics\/ \uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">\r\nprivate void DrawLine(\r\n    int X0, int Y0, int X1, int Y1, \r\n    XrMapLib.GridCells cells, \r\n    double Value)\r\n{\r\n    int dx = X1 - X0;\r\n    int dy = Y1 - Y0;\r\n\r\n    int steps = Math.Abs(dx) > Math.Abs(dy) ? Math.Abs(dx) : Math.Abs(dy);\r\n\r\n    float Xinc = dx \/ (float)steps;\r\n    float Yinc = dy \/ (float)steps;\r\n\r\n    float X = X0;\r\n    float Y = Y0;\r\n    for (int i = 0; i <= steps; i++)\r\n    {\r\n        cells.SetValue((int)Math.Round(Y), (int)Math.Round(X), Value); \r\n        X += Xinc; \r\n        Y += Yinc;\r\n    }\r\n}\r\n<\/pre>\n<p>\uadf8\ub9ac\ub4dc \ubd84\uc11d\uc5d0\uc11c \ud2b9\uc815 \uc9c0\uc810\uc5d0 \ub300\ud574 \uac12\uc744 \uc9c0\uc815\ud558\ub294 \ubc29\uc2dd\uc774 \uc544\ub2cc \uac12\uc744 \uc9c0\uc815\ud558\ub294 \ub300\uc0c1\uc744 \uc120(Line)\uc73c\ub85c \uc815\uc758\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C\uc5b8\uc5b4\ub85c \uad6c\ud604\ub41c \ucf54\ub4dc\ub97c C#\uc73c\ub85c \ubcc0\uacbd\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ucd9c\ucc98\ub294 https:\/\/www.geeksforgeeks.org\/dda-line-generation-algorithm-computer-graphics\/ \uc785\ub2c8\ub2e4. private void DrawLine( int X0, int Y0, int X1, int Y1, XrMapLib.GridCells cells, double Value) { int dx = X1 &#8211; X0; int dy = Y1 &#8211; Y0; int steps = Math.Abs(dx) > Math.Abs(dy) ? Math.Abs(dx) : Math.Abs(dy); float Xinc = dx \/ (float)steps; float Yinc &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=11093\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Line \uadf8\ub9ac\uae30 (DDA \uc54c\uace0\ub9ac\uc998)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-11093","post","type-post","status-publish","format-standard","hentry","category-gis-working-history"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11093"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11093\/revisions"}],"predecessor-version":[{"id":11094,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11093\/revisions\/11094"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11093"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}