math.answers.com/other-math/C_program_to_draw_parallel_lines
Preview meta tags from the math.answers.com website.
Linked Hostnames
8- 32 links tomath.answers.com
- 20 links towww.answers.com
- 1 link totwitter.com
- 1 link towww.facebook.com
- 1 link towww.instagram.com
- 1 link towww.pinterest.com
- 1 link towww.tiktok.com
- 1 link towww.youtube.com
Thumbnail

Search Engine Appearance
C program to draw parallel lines? - Answers
/* This is an incomplete program. The function below will draw two parallel lines, but depends on a putpixel function that is not defined here. Also of course needs a main function calling it somewhere, and all the other usual necessities. */ /* draw a line from point (x1, y1) to point (x2, y2) and another one that is (xoffset, yoffset) pixels away from it. Uses Bresenham's line algorithm and depends on a "putpixel" function */ void pline(int x1, int y1, int x2, int y2, int xoffset, yoffset){ int n, deltax, deltay, sgndeltax, sgndeltay, deltaxabs, deltayabs, x, y, drawx, drawy; deltax = x2 - x1; deltay = y2 - y1; deltaxabs = abs(deltax); deltayabs = abs(deltay); sgndeltax = sgn(deltax); sgndeltay = sgn(deltay); x = deltayabs >> 1; y = deltaxabs >> 1; drawx = x1; drawy = y1; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); if(deltaxabs >= deltayabs){ for(n = 0; n < deltaxabs; n++){ y += deltayabs; if(y >= deltaxabs){ y -= deltaxabs; drawy += sgndeltay; } drawx += sgndeltax; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } }else{ for(n = 0; n < deltayabs; n++){ x += deltaxabs; if(x >= deltayabs){ x -= deltayabs; drawx += sgndeltax; } drawy += sgndeltay; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } } }
Bing
C program to draw parallel lines? - Answers
/* This is an incomplete program. The function below will draw two parallel lines, but depends on a putpixel function that is not defined here. Also of course needs a main function calling it somewhere, and all the other usual necessities. */ /* draw a line from point (x1, y1) to point (x2, y2) and another one that is (xoffset, yoffset) pixels away from it. Uses Bresenham's line algorithm and depends on a "putpixel" function */ void pline(int x1, int y1, int x2, int y2, int xoffset, yoffset){ int n, deltax, deltay, sgndeltax, sgndeltay, deltaxabs, deltayabs, x, y, drawx, drawy; deltax = x2 - x1; deltay = y2 - y1; deltaxabs = abs(deltax); deltayabs = abs(deltay); sgndeltax = sgn(deltax); sgndeltay = sgn(deltay); x = deltayabs >> 1; y = deltaxabs >> 1; drawx = x1; drawy = y1; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); if(deltaxabs >= deltayabs){ for(n = 0; n < deltaxabs; n++){ y += deltayabs; if(y >= deltaxabs){ y -= deltaxabs; drawy += sgndeltay; } drawx += sgndeltax; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } }else{ for(n = 0; n < deltayabs; n++){ x += deltaxabs; if(x >= deltayabs){ x -= deltayabs; drawx += sgndeltax; } drawy += sgndeltay; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } } }
DuckDuckGo
C program to draw parallel lines? - Answers
/* This is an incomplete program. The function below will draw two parallel lines, but depends on a putpixel function that is not defined here. Also of course needs a main function calling it somewhere, and all the other usual necessities. */ /* draw a line from point (x1, y1) to point (x2, y2) and another one that is (xoffset, yoffset) pixels away from it. Uses Bresenham's line algorithm and depends on a "putpixel" function */ void pline(int x1, int y1, int x2, int y2, int xoffset, yoffset){ int n, deltax, deltay, sgndeltax, sgndeltay, deltaxabs, deltayabs, x, y, drawx, drawy; deltax = x2 - x1; deltay = y2 - y1; deltaxabs = abs(deltax); deltayabs = abs(deltay); sgndeltax = sgn(deltax); sgndeltay = sgn(deltay); x = deltayabs >> 1; y = deltaxabs >> 1; drawx = x1; drawy = y1; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); if(deltaxabs >= deltayabs){ for(n = 0; n < deltaxabs; n++){ y += deltayabs; if(y >= deltaxabs){ y -= deltaxabs; drawy += sgndeltay; } drawx += sgndeltax; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } }else{ for(n = 0; n < deltayabs; n++){ x += deltaxabs; if(x >= deltayabs){ x -= deltayabs; drawx += sgndeltax; } drawy += sgndeltay; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } } }
General Meta Tags
22- titleC program to draw parallel lines? - Answers
- charsetutf-8
- Content-Typetext/html; charset=utf-8
- viewportminimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no
- X-UA-CompatibleIE=edge,chrome=1
Open Graph Meta Tags
7- og:imagehttps://st.answers.com/html_test_assets/Answers_Blue.jpeg
- og:image:width900
- og:image:height900
- og:site_nameAnswers
- og:description/* This is an incomplete program. The function below will draw two parallel lines, but depends on a putpixel function that is not defined here. Also of course needs a main function calling it somewhere, and all the other usual necessities. */ /* draw a line from point (x1, y1) to point (x2, y2) and another one that is (xoffset, yoffset) pixels away from it. Uses Bresenham's line algorithm and depends on a "putpixel" function */ void pline(int x1, int y1, int x2, int y2, int xoffset, yoffset){ int n, deltax, deltay, sgndeltax, sgndeltay, deltaxabs, deltayabs, x, y, drawx, drawy; deltax = x2 - x1; deltay = y2 - y1; deltaxabs = abs(deltax); deltayabs = abs(deltay); sgndeltax = sgn(deltax); sgndeltay = sgn(deltay); x = deltayabs >> 1; y = deltaxabs >> 1; drawx = x1; drawy = y1; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); if(deltaxabs >= deltayabs){ for(n = 0; n < deltaxabs; n++){ y += deltayabs; if(y >= deltaxabs){ y -= deltaxabs; drawy += sgndeltay; } drawx += sgndeltax; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } }else{ for(n = 0; n < deltayabs; n++){ x += deltaxabs; if(x >= deltayabs){ x -= deltayabs; drawx += sgndeltax; } drawy += sgndeltay; putpixel(drawx, drawy); putpixel(drawx + xoffset, drawy + yoffset); } } }
Twitter Meta Tags
1- twitter:cardsummary_large_image
Link Tags
16- alternatehttps://www.answers.com/feed.rss
- apple-touch-icon/icons/180x180.png
- canonicalhttps://math.answers.com/other-math/C_program_to_draw_parallel_lines
- icon/favicon.svg
- icon/icons/16x16.png
Links
58- https://math.answers.com
- https://math.answers.com/other-math/C_program_to_draw_parallel_lines
- https://math.answers.com/other-math/How_many_significant_figures_for_0.0300
- https://math.answers.com/other-math/How_many_times_does_6_go_into_120
- https://math.answers.com/other-math/If_you_have_7_coins_that_equal_1.07_but_cannot_change_a_half_dollar_a_dime_or_a_nickel_What_coins_do_you_have