Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Gt

bit 65Mohi
tTi
war
i

I
T2

CGMAs
signme
nt1
QUES1ForBRESENHAM'SLI
NEALGORIT
HM(Case-m>1)
,
Youhav
et oequatetheequat
ionsandde
terminet
hec
oor
dinat
esaswe
ll.

AnswerThi
salgori
thmisusedfors
canc onv
ert
ingali
ne.I
twasde v
e l
opedbyBre se
nham.
Itisane f
fic
ientmethod bec
auseiti
nv ol
vesonl
yinte
ge raddit
ion,subt
rac
tions,and
multi
pli
cat
ionoperat
ions
.Thes
eoperat
ionscanbeper
for
me dveryrapidl
ysoli
ne scanbe
generat
edquickl
y.

I
nthi
sme
thod,
nex
tpi
xels
ele
cte
dist
hatonewhohast
hel
eas
tdi
st
anc
efr
omt
ruel
ine
.

T
heme
thodwor
ksasf
oll
ows
:

As
sumeapi x
elP1'
(
x1'
,
y1'
)
,t
hensele
ctsubse
que ntpix
e l
sasweworkourmayt
otheni
ght
,one
pi
xelpos
it
ionatatimeinthehori
zont
aldir
ec t
iontowardP2'
(
x '
,
y
2 2'
).

Onc
eapi
xeli
nchoos
eatanys
tep

T
hene
xtpi
xeli
s

1.E
ithe
rtheonet
oit
sri
ght(
lowe
r-boundf
ort
hel
ine
)
2.Onet
opi
tsr
ightandup(
uppe
r-boundf
ort
hel
ine
)

Theli
nei
sbe s
tappr
oxi
mat
edbyt
hos
epi
xel
sthatf
allt
hel
eas
tdi
st
anc
efr
om t
hepat
h
bet
weenP1'
,
P2'
.
Gt
bit 65Mohi
tTi
war
i

I
T2

T
ochoosesthenextonebe
twe
ent
hebot
tompixe
lSandt
oppi
xelT
.
IfSischosen
Wehav ex
i+1=xi
+1 and yi+1=yi
IfTischos
en
Wehav ex
i+1=xi
+1 and yi+1=yi
+1

T
heac
tualycoordi
nat
esoft
hel
ineatx=x
i+1i
s
y=mxi
+1+b

Bres
enham'sL
ineAl
gor
ithm
Thedis
tanc
efromStotheact
uall
inei
nydi
rec
tion
s=y-yi

T
hedi
st
ancefromTt
otheac
tuall
inei
nydi
rec
tion
t=(
yi+
1)-y

Nowconsi
derthedi
ff
ere
ncebe
twe
ent
hes
e2di
st
anc
eval
ues
s–t
When(s-
t)<0⟹ s<t

T
hec
los
estpi
xeli
sS

Whe
n(s
-t)≥
0⟹ s<t

T
hec
los
estpi
xeli
sT

T
hisdi
ff
erenceis
s
-t=(y-yi
)-
[(
yi+
1)-y]
=2y-2yi-1

s
-t=
2m(
xi
+1)
+2b-
2yi
-1 [
Put
ti
ngt
hev
alueof
(1)
]

Subs
ti
tut
ingmbyBr e
senham'
sLineAl
gorit
hmandintr
oducingde
cis
ionv
ari
abl
e
di
=△x(s-
t)
di
=△x(2Br ese
nham'sL
ineAlgor
it
hm(xi
+1)
+2b-2yi
-1)
=2△xyi-2△y-1△x.
2b-2yi△x-△x
di
=2△y.x
i-2△x .
yi
+c

Whe
rec
=2△y+
△x(
2b-
1)

Wec anwrit
ethede c
isionv ar
iabledi+
1f orthene
xts
li
pon
di+
1=2△y.xi+1-2△x .
yi+1+
c
di+
1-di=
2△y. (xi
+1-xi
)-2△x (
yi+
1- yi
)
Si
ncex_(i
+1)
=xi
+1,
wehav e
di+
1+di=2△y.(xi+
1-xi
)-2△x (
yi+1-yi
)
Spec
ialCases

I
fchos
enpi
xeli
satt
het
oppi
xelT(
i.
e.
,di
≥0)
⟹ yi
+1=
yi+
1
Gt
bit 65Mohi
tTi
war
i

I
T2

di
+1=
di+
2△y-
2△x

I
fchos
enpi
xelisatt
hebot
tompi
xelT(
i.
e.
,di
<0)
⟹ yi
+1=
yi
di
+1=di+
2△y

F
inal
ly,
wec alc
ulated1
d1=
△x [2m(x
1+1)
+2b-
2y1-
1]
d1=
△x [2(
mx1+b-
y1)+
2m-1]

Si
ncemx
1+b-yi
=0andm=Br
ese
nham'
sLi
neAl
gor
it
hm,
wehav
e
d1=
2△y- △x

E
xampl
e:St
art
ingandE
ndi
ngpos
it
ionoft
hel
inear
e(1,
1)and(
8,5)
.Fi
ndi
nte
rme
diat
epoi
nts
.

Sol
uti
on:
x 1=1
y1= 1
x2 =
8
y2= 5
dx =x2-x1=8-1= 7
dy= y2-y1= 5-1=4
I1=2*∆y= 2*4=8
I2=2*(
∆y- ∆x )
= 2*
(4-
7)=
-6
d=I 1-∆x =8-7= 1

x y d=
d+I

orI
2

1 1 d+
I2=
1+(
-6)
=-5

2 2 d+
I1=
-5+
8=3

3 2 d+
I2=
3+(
-6)
=-3

4 3 d+
I1=
-3+
8=5

5 3 d+
I2=
5+(
-6)
=-1

6 4 d+
I1=
-1+
8=7

7 4 d+
I2=
7+(
-6)
=1

8 5
Gt
bit 65Mohi
tTi
war
i

I
T2

QUE
S2Mak
eac
ompl
etet
axonomyonT
opi
c–PROJ
ECT
ION.

AnswerPlanargeometri
cproje
cti
onsar
eclassi
fi
edbasedont
he proj
ect
ion 
planeaswellascent
er
ofproje
ction.Apr
oje
ctoriss
aidtobea 
li
ne pass
ingt
hroughapointi
nanobj ectandt
hec ent
erof
theproje
ct i
on.

Paral
lelproj
ecti
ons
Paral
lelproj
ect
ionformswhent
hecenterofthepr
ojec
tioni
spointi
ngtoinf
init
y.Allthe
proj
ect
or s
 wi
ll
 ef
fec
tiv
elybepar
all
eltoeachother
.Theimagesarenotre
ali
s t
icthroughthe
paral
lelproj
ect
ionwhe nc
omparedwit
ht hehumaneye.Thi
sisdi
videdi
ntotwot ypes:
Gt
bit 65Mohi
tTi
war
i

I
T2

•Or thogr aphi cpar alle lproj ecti


ons
•Obl iquepar al lelpr oje ct
ions
Orthogr aphi cpr oje ction
Allthepr oj ect orsar epe rpe ndicul artot hepr ojec tedpl anei ntheor thogr aphi cpr ojecti
on.
Mul t
iv iewOr thogr aphi cpr ojection
Inamul tiviewOr thogr aphi cpr oje cti
on, thepr oje ctedpl anei spar alleltoal lthepr incipalfaces
.
Thati sf romf r ontv iew, topv i
ew, aswe llast hes idev iew. Thisisoftens eenint heComput erAided
De si
gn( CAD) .
Axonome tr i
c
Thisisoft hr eet ype s:
• 
Isome tricpr oje ction  oc curswhe nal lt hepr incipalax esofapar ticularobj ectinte rs
ec tatthe
proje ctionpl anewi tht hes ameangl e.
• 
Di me t ri
cpr oj ection  oc cur swhe nt wopr i
nc ipalax esint ers
e ctthepr ojectedpl aneatt hes ame
angl e, andt her estoft hepr incipalax esint er sectatadi f
ferentangl e .
• 
Trime tricpr ojec tion  oc c
ur swhe nal lthet hr eeangl esintersectatdi fferentangl es .
Obliquepar al lelpr ojec ti
on
Thepr ojec torl ine swi lli ntersectt hepr oj ectedpl aneatac ert
ainangl einanobl iquepar alle
l
proje ction. The rear et wot ype sofObl iquepar al
le lproje cti
ons .
•Ina  c av alierpr oj ection  t
heangl eoft hepr ojecte dlinesar eatanangl eof45de grees .
•Ina  c abi ne tpr oj ec ti
on  theangl eoft hepr oje c
te dl i
ne sareatanangl eof64de gr ees.
Perspe ctivepr oje ction:
Ape r spe ctivepr oje ctions howst hel i
nesoft hepr ojectorc onve r
geatc entreofpr ojecti
ont hat
resultss ev eralv i
s uale ffectsofanobj ec t:
• 
Par al lelline s whi c har enoti napl anepar allelt othepr ojectedplanewi llconv ergeatt hee nd
point .
•Thev ar i
at ioni nt hes i
z eoft heobj ect
si sbas e dondi stanc efromc entreofpr oje
c ti
on.
Bas edont hepr i
nc ipl eax isandpr ojecte dpl aneofanobj ect,ape rspe ct
ivepr ojectionisdiv i
ded
i
nt ot hr eet ype s
:
•One -pointpe rspe c ti
v epr ojec t
ion
•Two- pointpe rspe c ti
v epr ojec t
ion
•Thr ee -poi ntpe rspe ctivepr ojection
One -poi ntpe r spe ctivepr oje cti
on:
Ape r spe ctivepr oje ctiont hatf or mswhe nt he reisas inglepr i
nciplefac ethati spar alleltothe
proje ctedpl ane .Thi siss impl ys aidasas ingl ee ndpoi nte xist
sf oranobj ect.
Two- poi ntpe r spe ctivepr oje cti
on:
Ape r spe ctivepr oje ctiont hatf or mswhe nt he reisapr ojectedpl anei nter
se ctsatt wopr i
ncipal
axesofanobj e ctt hati st woe ndpoi ntse xi
s tf oranobj ect.
Three -poi ntpe rspe c t
iv epr ojection:
Ape r spe ctivepr oje ctiont hatf or mswhe nt he reisapr ojectedpl anet hatinte rsect
satt hr ee
princ i
palax esofanobj ectthati st hreee ndpoi nt sexistforanobj ect.
Gt
bit 65Mohi
tTi
war
i

I
T2

Ass
ignme nts
olut
ionsby:
Mohi
tTi
war
i
Batch:I
T-2
RollNo.65

You might also like