**1.C] Explain the DDA line drawing algorithm with its procedure**

### Digital Differential Analyzer (DDA) Algorithm

## 1. Slope Calculation

**Slope (m):** The slope of the line between two points `(x`

and _{1}, y_{1})`(x`

is calculated using the formula:_{2}, y_{2})

m = (Δy / Δx) = (y

_{2}– y_{1}) / (x_{2}– x_{1})## 2. Finding Δx and Δy

**Δx and Δy:** The change in x (Δx) and the change in y (Δy) can be computed depending on the slope `m`

and the coordinates of the points.

The formula for **Δx** is derived as follows:

Δx = Δy / m = (x

_{2}– x_{1}) / (y_{2}– y_{1}) * Δy = x_{2}– x_{1}The formula for **Δy** is:

Δy = y

_{2}– y_{1}Another formula for **Δy** derived from the slope `m`

and `Δx`

is:

Δy = m * Δx = (y

_{2}– y_{1}) / (x_{2}– x_{1}) * Δx = y_{2}– y_{1}## 3. Decision Rules for Incrementing Points

**If |Δx| ≥ |Δy|:**

- In this case,
`x`

is incremented by 1: - The next x-coordinate (
`x`

) is:_{i+1} - The next y-coordinate (
`y`

) is:_{i+1}

Δx = 1

x

_{i+1}= x_{i}+ Δx = x_{i}+ 1y

_{i+1}= y_{i}+ Δy = y_{i}+ m * Δx = y_{i}+ m**If |Δx| < |Δy|:**

- In this case,
`y`

is incremented by 1: - The next x-coordinate (
`x`

) is:_{i+1} - The next y-coordinate (
`y`

) is:_{i+1}

Δy = 1

x

_{i+1}= x_{i}+ Δx = x_{i}+ Δy / m = x_{i}+ 1 / my

_{i+1}= y_{i}+ Δy = y_{i}+ 1**Answer**:

Example:-