Added to Favorites

Related Searches

Nearby Words

A line drawing algorithm is a graphical algorithm for approximating a line segment on discrete graphical media. On discrete media, such as pixel-based displays and printers, line drawing requires such an approximation (in nontrivial cases).## A naïve line-drawing algorithm

## List of line drawing algorithms

The following is a partial list of line drawing algorithms:

On continuous media, by contrast, no algorithm is necessary to draw a line. For example, oscilloscopes use natural phenomena to draw lines and curves.

```
```

`dx = x2 - x1`

```
```dy = y2 - y1

for x from x1 to x2 {

y = y1 + (dy) * (x - x1)/(dx)

plot(x, y)

}

It is assumed here that the points have already been ordered so that $x\_2\; >\; x\_1$.
This algorithm works just fine when $dx\; >=\; dy$, but it is quite slow on a digital computer, as it requires floating-point calculations. If $dx\; <\; dy$, the line becomes quite sparse, and in the limiting case of $dx\; =\; 0$, only a single point is plotted!
- Bresenham's line algorithm — optimized to use only additions (i.e. no divisions or multiplications); it also avoids floating-point computations.
- Xiaolin Wu's line algorithm — can perform anti-aliasing
- EFLA line algorithm — A very fast implementation.
- gatopeich's line algorithm — Fast, simple, aesthetic. Based on pure integer operations.

Wikipedia, the free encyclopedia © 2001-2006 Wikipedia contributors (Disclaimer)

This article is licensed under the GNU Free Documentation License.

Last updated on Sunday June 08, 2008 at 16:45:25 PDT (GMT -0700)

View this article at Wikipedia.org - Edit this article at Wikipedia.org - Donate to the Wikimedia Foundation

This article is licensed under the GNU Free Documentation License.

Last updated on Sunday June 08, 2008 at 16:45:25 PDT (GMT -0700)

View this article at Wikipedia.org - Edit this article at Wikipedia.org - Donate to the Wikimedia Foundation

Copyright © 2015 Dictionary.com, LLC. All rights reserved.