![[../../../../00 Asset Bank/CS200F24L7.pdf|CS200F24L7]] - [[CS200F24L7 Finals Review]] ## Problem 2 #### a. We are able to scan convert the line segment from endpoint $l_0 =(30,35)$ to endpoint $l_{1}=(75, 10)$. $ m = \frac{l_{1}}{l_{0}} = \frac{10-35}{75-30} = -\frac{5}{9} $ $|m|$ is less than one, so we should scan by $\pm x$. $ 30 < 75 $ Therefore the axis we need to scan in respect to is $+x$. #### b. The 31st pixel would be $l_{0} + m(31-30)$ $\begin{align} p_{31} &= 35 -\frac{5}{9}(30) \\ &= \frac{55}{3}\\ &= 18.\bar{3}\\ \op{round}\pa{ p_{31}} &= 18 \end{align} $ The 31st pixel is at $(60,18)$ ### Problem 3 #### Question A Scan convert the line segment from $l_0=(59,24)$ to $l_{1}=(91,74)$ $ m = \frac{74-24}{91-59} = \frac{25}{16} $ Should scan by $+x$. $ \begin{align} y(x) &= 24 + \frac{25}{16}\pa{x} \\ \op{round}(y(15-1)) &= 46 \end{align} $ The 15th pixel is $(73,46)$