L4 Pre-session Material NK
L4 Pre-session Material NK
Session No.: 4
In computer graphics, images are formed using basic geometric primitives such as points, lines, and
curves. Among these, lines are the fundamental building blocks of most graphics applications.
Modern displays, such as LCD and LED screens, consist of a grid of pixels. Every graphical element,
whether a simple shape or a complex 3D model, is ultimately represented using points and lines.
A point is the smallest unit of a graphical object. It represents a single pixel on the screen. In
mathematical terms, a point is defined by a coordinate pair (x, y) in 2D or (x, y, z) in 3D.
A point by itself does not form a shape, but multiple points connected together can form lines,
curves, and polygons.
A line is a collection of multiple points that form a continuous path between two endpoints.
y=mx+cy = mx + cy=mx+c
where:
• mmm = Slope of the line (change in y over change in x).
A straight line is the shortest path between two points (x1, y1) and (x2, y2).
• Horizontal Line: When y1 = y2, the line remains constant along the y-axis.
• Vertical Line: When x1 = x2, the line remains constant along the x-axis.
• Curved Lines: These are not true "lines" but are represented using multiple small connected
line segments.
Ax+By+C=0
y=mx+c
Since screens use discrete pixels, a "perfect" line must be approximated using line-drawing
algorithms. This is where DDA (Digital Differential Analyzer) Algorithm and Bresenham’s Line
Algorithm are used (covered in upcoming lectures).
Challenge: Since screens have limited pixels, drawing a smooth line requires handling pixel
placement efficiently to avoid gaps or jagged edges (aliasing).
7. Applications of Points and Lines in Computer Graphics