answersLogoWhite

0

If you're wondering about the "Bresenham line algorithm", it is an algorithm (a process used for making a desired result) that plots a geometrical line (consiting of infinate points, as if you draw a straight line on a piece of paper) and translates it to a computer screen (composed of pixels, or video "points" that have a specific amount of sized points) The algorithm is as follows: function line(x0, x1, y0, y1)

boolean steep := abs(y1 - y0) > abs(x1 - x0)

if steep then

swap(x0, y0)

swap(x1, y1)

if x0 > x1 then

swap(x0, x1)

swap(y0, y1)

int deltax := x1 - x0

int deltay := abs(y1 - y0)

int error := -(deltax + 1) / 2

int ystep

int y := y0

if y0 < y1 then ystep := 1 else ystep := -1

for x from x0 to x1

if steep then plot(y,x) else plot(x,y)

error := error + deltay

if error ≥ 0 then

y := y + ystep

error := error - deltax This algorithm was taken from the site http://en.wikipedia.org/wiki/Bresenham's_line_algorithm

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

What is algorithm to write algorithm to the program to access a pointer variable in structure?

Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.name_of_the_structure dot name_of_the _field,eg:mystruct.pointerfield


Which algorithm is more efficient lamport bakery algorithm or black and white bakery algorithm?

Black and White bakery algorithm is more efficient.


What is complsexity of an algorithm?

Complexity of an algorithm is a measure of how long an algorithm would take to complete given


How algorithm is different from flowchart?

An algorithm is a series of steps leading to a result. A flowchart can be a graphical representation of the algorithm.


List down the names of any three parameters on which you analyze an algorithm?

what is algorithm and its use there and analyze an algorithm


How do you test algorithm?

By preparing test cases we can test an algorithm. The algorithm is tested with each test case.


Define algorithm and explain its criteria?

algorithm criteria


How are expanded algorithm and the standard algorithm different?

Yes


What is algorithm evaluation?

evaluation iz same as the testing of an algorithm. it mainly refers to the finding of errors by processing an algorithm..


What is algorithm write properties of algorithm?

An ALGORITHM is a sequence of steps that depicts the program logic independent of the language in which it is to be implemented. An algorithm should be designed with space and time complexities in mind.


Is Dijkstra's algorithm a greedy algorithm?

Yes, Dijkstra's algorithm is a greedy algorithm because it makes decisions based on the current best option without considering future consequences.


What is the Graham scan algorithm?

An algorithm for constructing the convex hull