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.