Line Drawing: Difference between revisions

From Algorithm Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 28: Line 28:
|}
|}


== Time Complexity graph ==  
== Time Complexity Graph ==  


[[File:Line Drawing - Time.png|1000px]]
[[File:Line Drawing - Time.png|1000px]]


== Space Complexity graph ==  
== Space Complexity Graph ==  


[[File:Line Drawing - Space.png|1000px]]
[[File:Line Drawing - Space.png|1000px]]


== Pareto Decades graph ==  
== Pareto Frontier Improvements Graph ==  


[[File:Line Drawing - Pareto Frontier.png|1000px]]
[[File:Line Drawing - Pareto Frontier.png|1000px]]

Revision as of 14:04, 15 February 2023

Description

Given a line segment with endpoints $(x_0, y_0), (x_1, y_1)$ and a discrete graphical medium (like pixel-based displays and printers), draw/approximate the line segment on the medium, potentially with antialiasing.

Parameters

n: number of pixels the line goes through

Table of Algorithms

Name Year Time Space Approximation Factor Model Reference
Naive algorithm 1940 $O(n)$ $O({1})$ auxiliary Exact Deterministic
Digital Differential Analyzer 1940 $O(n)$ $O({1})$ auxiliary Exact Deterministic
Bresenham's line algorithm 1965 $O(n)$ $O({1})$ auxiliary Exact Deterministic Time
Xiaolin Wu's line algorithm 1991 $O(n)$ $O({1})$ auxiliary Exact Deterministic Time
Gupta-Sproull algorithm 1981 $O(n)$ $O({1})$ auxiliary Exact Deterministic Time

Time Complexity Graph

Line Drawing - Time.png

Space Complexity Graph

Line Drawing - Space.png

Pareto Frontier Improvements Graph

Line Drawing - Pareto Frontier.png