Algorithm series (10) Line generation algorithm

Source: Internet
Author: User
Tags time 0

In Euclidean geometry space, the plane equation is a ternary equation, the line is the intersection of two non parallel planes, so the linear equation is two ternary equations. But in plane analytic geometry, the equation of the straight line is much simpler. There are many forms of linear equations in plane geometry, and general linear equations can be used to describe all straight lines:

Ax+by+c = 0 (A, b not at the same time 0)

You can use the point-oblique equation when you know that a point coordinate (x0,y0) on a line and the slope K of a line exist:

Y-y0 = k (x–x0) (when K does not exist, the line equation is reduced to X = X0)

When you know two points (x0,y0) and (x1,y1) on a line, you can also use the two-point equation to describe the line:

In addition to these three kinds of linear equations, the linear equation has many forms, such as intercept type, oblique intercept type and so on.

A line in mathematics is a set of dots without widths, but in the context of computer graphics, all graphics, including lines that are output or displayed on a dot-matrix device, are either lattice or raster graphics. In the case of a display, a common display in the real world, including CRT monitors and liquid crystal displays, can be viewed as a pixel matrix of pixels of various colors and shades of gray values, which are of a size and fixed position, so that only a variety of graphs can be approximated. Figure (1) is an exaggerated amplification of this situation:

Figure (1) The expression of a straight line on a lattice device

The algorithm of line generation in computer graphics, in fact, contains two layers of meaning, one layer is in the analytic geometry space according to coordinate constructs plane line, another layer is in raster display and so on dot-matrix equipment to output a pixel line most approximation to the graph, and this is often said raster graphics scan conversion. This paper introduces several common line-generated raster scan conversion algorithms, including numerical differential method (DDA method), Bresenham algorithm, symmetric line generation algorithm and two-step algorithm.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.