0% found this document useful (0 votes)
4 views3 pages

L4 Pre-session Material NK

This document serves as study material for a Computer Graphics course, focusing on the concepts of points and lines as fundamental geometric primitives in graphics. It explains the definitions, representations, and types of points and lines, along with their mathematical equations and digital representation techniques. Additionally, it highlights various applications of points and lines in graphics, such as UI design, modeling, and data visualization.

Uploaded by

Mohammad Maaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

L4 Pre-session Material NK

This document serves as study material for a Computer Graphics course, focusing on the concepts of points and lines as fundamental geometric primitives in graphics. It explains the definitions, representations, and types of points and lines, along with their mathematical equations and digital representation techniques. Additionally, it highlights various applications of points and lines in graphics, such as UI design, modeling, and data visualization.

Uploaded by

Mohammad Maaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Study Material: Points and Lines in Computer Graphics

Course: Computer Graphics (R1UC408B)

Instructor: Dr. Namrata Kumari

Session No.: 4

Semester: IV | Academic Year: 2024-25

1. Introduction to Points and Lines in Computer Graphics

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.

2. Understanding Points in Computer Graphics

2.1 What is a Point?

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.

2.2 Representation of a Point

• 2D Point Representation: P(x,y)P(x, y)P(x,y) → Defines a location on a plane.

• 3D Point Representation: P(x,y,z)P(x, y, z)P(x,y,z) → Includes depth along with x and y


coordinates.

2.3 Example of a Point in a 2D Space

If we have a 500×500 pixel screen, a point at (100, 200) means:

• 100 pixels from the left.

• 200 pixels from the top.

A point by itself does not form a shape, but multiple points connected together can form lines,
curves, and polygons.

3. Understanding Lines in Computer Graphics

3.1 What is a Line?

A line is a collection of multiple points that form a continuous path between two endpoints.

In a mathematical sense, a line is represented using a linear equation:

y=mx+cy = mx + cy=mx+c

where:
• mmm = Slope of the line (change in y over change in x).

• ccc = Y-intercept (where the line meets the y-axis).

4. Line Types in Computer Graphics

4.1 Straight Line

A straight line is the shortest path between two points (x1, y1) and (x2, y2).

• Used in basic graphics rendering, UI elements, and shape creation.

4.2 Horizontal and Vertical Lines

• 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.

4.3 Diagonal and Curved Lines

• Diagonal Line: Formed when x and y both change at equal rates.

• Curved Lines: These are not true "lines" but are represented using multiple small connected
line segments.

5. Line Equations in Computer Graphics

5.1 General Form of a Line Equation

Ax+By+C=0

• This form helps in identifying if a point lies on a line.

• Useful in intersection calculations.

5.2 Slope-Intercept Form

y=mx+c

• Helps in determining the steepness of a line.

• Example: If m = 1, the line moves 45 degrees upward.

6. Digital Representation of Lines in Graphics

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

✔ Line drawing in UI design (borders, dividers).


✔ 2D and 3D modeling (wireframe graphics).
✔ Roadmaps and pathfinding algorithms (navigation systems).
✔ Graphical representations in data visualization.
✔ Shape rendering (rectangles, circles, polygons).

You might also like