You are on page 1of 57
oa RECTANGLE ELLIPSE Vi. Algorithm Step Stok Step! Ceclaor & detect grro.phics daiver - Steps : Declowe vormobles . Step: Tnitiolize qwaphic mo Steps: co potpixel A With appropaote Sheps : ca ele Fartion woth oppoopiek ‘Step ts coll ciclo, function “odin oppaap rete oR fanetfes oth sepa pce Computer Graphics (22318) IX. Flow Chart pte ( r peter Specification Quantity | Remarks 1 | Hardware: Computer (i3-i5 preferable), Computer RAM minimum 2 GB and System onwards but not limited to ~ = ; As per batch For all Windows XP/Windows a ates | 7/LINUX version 5.0 or later, pa Turbo C/C++ Version 3.0 or later with DOSBOX XI. Precautions © 1. Ensure that all C statements me ‘Use white spaces in C to describe blanks and tabs. 4. Follow safety/ethical practices. must end with a semicolon (;). 3. Ensure use of proper-graphics function for relevant object. Specification Practical Related Note: Below given are few sample questions for reference, Teacher must design the achievement of identified CO. ‘more such questions so as to ensure (Note: Use Point VIII to X and XIII to XV for all relevant programming exercise use blank pages provided or attach more pages if needed.) 1. Find the minimum and maximum coordinates of screen. 2. What is graphics driver and graphics mode? 3. What is path of graphics driver? 4, Find error of the following code: - putpixel(20,20); outtextxy(25,25,”PIXEL”); } 5. List four applications of Computer graphics. 6. Define terms pixel, line and raster scan graphics. (Space for answers) ~ Computer Graphics (22318) XVL_ Exercise © AD Velarksren + ‘Attempt QI. and teacher shall allot Q. 2/Q.3 from the following: (Note: Use Point VIII to X and XIII to XV for all relevant programming exercise use lank pages provided or attach more pages if needed.) 1, Write a C program to display following objects. OY two - GO { t { | ionomers (Space for Answers) disp fallout ‘Maharashtra State Board of Technical Education jics (22311 Teas ae. Accepts cant a a ea Skepa. o- C Mee ae Ph A Stepdi- ale rou ob = Hha-h Pornt of the lira a yet : atepu g- TF os By) Anan engin ® my th = SY Brees & Anc= (oe) | we a ai pun Step 68- py ee (v. ) Ge Ys 205% C44) 2. Step 1o- Mow) Plot ths Pane ‘an , 1X. Flow Chart conte CPC ah) ce 2 por Cay} = Wr oe Accept (1%) ROG, Ye ert 4 Bocs Ha -WH 4 : DA 4r=4p Step 82 SOP XVI. Practical Related Questions Note: Below given are few sample questions for reference. Teacher must design ensure the achievement of identified co. ‘more such questions so as to .d XIII to XV for all relevant programming exercise US VIII to X ant (Note: Use Point provided or attach more pages if needed.) pages rach 1, Define the term Rasterization. 2. Write slope intercept form of a line. 3, Write advantages and disadvantages of D) DA algorithm. (Space for Answers) VU. Minimum Theoretical Background Bresenham's line algorithm Bresenham's line algorithm determines the points of an n-dimensional raster that is selected to form a close approximation to a straight line between two points. It is used to draw line primitives in a bitmap image , as it uses only integer addition, subtraction and bit shifting. It is an incremental error algorithm. It is one of the earliest algorithms developed in the field of Computer graphics. Consider a line with initial point (x1, y1) and terminal point (x2, y2) in device space If Ax = x2 — x1 and Ay = y2 — yl, we define the driving axis (DA) to be the x-axis if {Ax|> |Ayi, and the y-axis if |Ay| > |Ax|. The DA is used as the “axis of contro!” for the algorithm and is the axis of maximum movement. Within the main loop of the algorithm, the coordinate corresponding to the DA is incremented by one unit. The coordinate corresponding to the other axis (usually denoted the passive axis or PA) is ‘only incremented as needed. : : ‘ F Input the two line end-points, storing the left end-point in (x05) Plot the point (Xo, Yo) a Calculate the constants Ax, Ay, 2Ay, and (2Ay - 2Ax) and get the first value for the decision parameter as:Py = 2Ay — 2Ax At each x; along the line, starting at k=0, perform the following test: If px< 0, the next point to plot is (xx+1, yx) and peui= Px + 2Ay Otherwise, the next point to plot is (xx+1, yt) and peer= Px + 2AY —2Ax 5. Repeat step 4 (Ax ) times. it xi le: hia ae : va Algortem St CP) 8- frccept C4) & eee 4) fee eee ee step 28> ae Am = (92-7) By = Cya-41) ec a, ow ep s- Hee aes aoe steps” ETD Powe Coy, Yr ee wile PBS eS eat S cei) Pe > Srept §- Repeor CO a pent - Sep % 8- Ste ter Graphics (22318) Resources required r, | Name of Specification Quantity Remarks | Computer (i3-i5 preferable), RAM minimum 2 GB and onwards but not limited to Asper batch |. For all Windows XP/Windows size Experiments TILINUX version 5.0 or later Turbo C/C++ Version 3.0 or later with DOSBOX . Precautions 1, Ensure that all C statements must end with a semicolon ch 2. Use white spaces in c to describe blanks and tabs. 3, Ensure use of proper graphics function for relevant object. 4, Follow safety/ethical practices. [l. Resources used Specification §. No] Name of Resource 25, GREEN 4G RAM 7 | Computer System with broad specifications 2 | sofware “Forbo C++ ed i a Ore Les’ IV. Result (Output of the Program) ” ‘6 " questions for reference. Teacher must design dimpenievement of identified CO se yop XIII to XV for all relevant programming exercise more pages if needed.) & Computer Graphics (22318) XVII. Exercise Attempt Q1. and teacher shall allot Q. 2/Q.3 from the following: (Note: Use Point VIII to X and XIII to XV for all relevant programming exercise use blank pages provided or attach more pages if needed.) i, Give following values for every iteration of Bresenham’s algorithm to draw a line from(3,4) to(6,8) Ox “by 2x 2ay P a ii, Give following values for every iteration of Bresenham's algorithm to draw a line from(-6,-6) to(-14,-14) ox ‘ay 20x ay P == (Space for Answers) ud References / ae 1. https://books.google.cqi ; 2 biotnce ecbe aster nou Computereience-Books- Download Basics: Computer-Graphics.html 3. http://www. freetechbooks.com/introduction-to-computer-graphics-t892.htm! 4. https://en. wikipedia.org/wiki/Book:Game_Devel_Book 2 XIX. Assessment Scheme Performance indicators Weightage | Process related (10 Marks) 30% | 1, [Debugging ability 20% 2. __| Follow ethical practices. T 10% Product related (15 Marks) 70% 3._| Correctness of algorithm 15% 4. | Correctness of Program codes 30% 5, _ | Quality of input/output messaging and output : i 10% 6. _| Timely Submission of report 3% 7._| Answer to sample questions 10% Total (25 Marks) 100% Ceclare anh datect the graphy datve Caloulecte Fnitial ducision variable Pie BD HY aco &y-r - s % (P40) + aioe & Cpt y=0) Mes OX 1 1c. ania - pez Pie UU : ee alm pre A Pro gine Aan a OLEaNTs 3 - ploy 14) | por C%)" ) plore (41%) _ | Por 4%) Plor Computer Graphics (22318) XIII. Resources used S. No, Name of Resource Specification Computer System Mia, QR with broad specifications | YC. (a) Cove (2) 19 Ag Software Toal00 c+t et ‘Any other resource used | Pointers - XIV. Result (Output of the Program) symmetry of a circle. yor (6) is calculated. XVHL. Exercise ‘Attempt Q1. and teacher shall allot Q.2/Q.3 from the following: (Notes Use Point VIII to X and XIII to XV for all relevant programming exercise us¢ blank pages provided or attach more pages if needed.) 1. Calculate pixels for a circle with radius 10 using Bresenham’s algorithm. iy Conte Ogee eo VI. Relevant Affective domain retated Outcome(s) a. Experiment with graphics environment. b. Follow safety/ethical practices. . Maintain tools and equipment. Minimum Theoretical Background ced and examine the neighboring pix.) ls Flood Fill Algorithm In Flood Fill algorithm we start with some sect & i however pixels are checked for @ specified interior color instead of boundary co, and is replaced by a new color. It can be done using 4 connected or 8 connecs nd region method. Procedure: Flood-fill (node, target-color, replacement-color): 1. If target-color is equal to replacement-color, return. 2. If the color of node is not equal to target-color, return. 3. Set the color of node to replacement-color. 4. Perform Flood-fill (one step to the south of node, target-color, replacement-color) Perform Flood-fill (one step to the north of node, target-color, replacement-color). Perform Flood-fill (one step to the west of node, target-color, replacement-color). Perform Flood-fill (one step to the cast ‘of node, target-color, replacement-color) 5. Reta. Example : circle(100,100,50); floodfill(100,100,RED); Fills the circle with red colour. VILL. Algorithm Flood Rll Cov,y , new color", ald. color )- ~ old ~~) a Ie pixel (%,y) a 2 por pinch C% 4, nev. Colo) Flood? | (% +1, 4 old — colo?) 1 MEW COLO peur color, Ok — color ) ep) New-colom , old - ea 0107.) } Shect Seed Pixel jee kata ae Crreakn polugqon ; ae Qoly oor ual Seed Sheen sa] a Specification Quantity Computer (i3-i5 preferable), RAM minimum 2 GB and onwards but not limited to Windows XP/Windows T/LINUX version 5.0 or later Turbo C/C++ Version 3.0 or later with DOSBOX XI. Precautions 1. Ensure that all C statements must end with a semicolon (;). 2. Use white spaces in c to describe blanks and tabs. 3. Ensure use of proper graphics function for relevant object. 4. Follow safety practices. XH. Resources used Name of Resource i { ‘Computer System with broad specifications 2 | Software 3 | Any other resource used As per batch size Specification XII. Result (Output of the Program) XV. Practical Related Questions Note: Below given are few sample questions for reference, Teacher must desig" more such questions so as to ensure the achievement of identified CO. (Note: Use Point VIII to X and XIII to XV for all relevant programming exercise us blank pages provided or attach more pages if needed.) 1. Define polygon. 2. Explain types of polygon. 7 Ye SSRN WORE “PUPP ae poy leer wor er = appear pe ere Maharashtra State Board of Technical Education Daiee ee - 2 F as al 3.List Coordinates of neighboring pixels in 8-connected method for seed pixel with _ 4.List Coordinates of neighboring pixels in-4-connected method for seed. pixel with coordinates(x,y) 5. Explain inside-outside test of polygon. (Space for Answers) ee — function which gives colour og wore nee ch speed colt 2 comet bl in mr i ro Bt gc pn i ota = NNE the “amatch is true. ‘Algorithm is a8 follows poundary, F411 (x Yr feolout, p_colout) : — wit = Bu colour 66 getpixel (%, y)! # f_colour) colour! b_colour)/ putpinel y Ea filite + te Yr oe colour, eyctailtn = ty Yr fleolouty P. colour)? ry fal, yt) colour, b_colour) / i, f eolout, b_colour) i wry £411 (MY ~ oa rand +i yt J, f_colowz, b_colour) rei tx = he Fcolour, b_eolour) Ponesry suit y= ¢ colour, b_colour) - boundary tulix 2) ¥* 2 flcolour, b_ colour) + yr ‘Step 1 ~ Initialize the value of seed point seedx, seedy, feolor and deol. ‘Step 2~ Define the boundary values ofthe polyBon toup3~ Check ite creat sed point i of default oo, then repeat he steps 4 ‘and 5 till the boundary pixels reached.. ‘sep 4~ Change te default color withthe fil color tthe seed point ‘Step §~ Recusvely follow te procedure wth four neighborhood points et ory a color , b-tolom ). 1 2b- sce ga gerbe! feet (NOK) © 4) rar sm, '0-(ol0)- ‘con ae color b- colo”)! H-1141¢- toler, be lor) . : mY), eel b- Color). “ XI. Resources required Remarks Computer (i3-i5 preferable), RAM minimum 2 GB and onwards but not limited to As per batch For all } Experiments Turbo C/C++ ater with DOSBOX ents must end with a semicolon (;). describe blanks and tabs. hics function for relevant object. Precautions % 1, Ensure that all C statem 2 Use white spaces in ¢ to 3. Ensure use of proper grap 4. Follow safety/ethical practices. Specification Pritel (AV Core 9 ROM UGS : Torsko Crt : Cor pages if needed.’ npr Somes nd sed nod : : a { 2. Identify type of polygon in following diagrams, Seer 3.Give the basic difference between flood fill and boundary fill. (Space for Answers) M2 OC Yn, BOK, KY Src, Sy ) Enter Q ren volurs of to. @ ly R= % XEN Q yreyarty Eo pe object Obtain AManslot? weer & Read Sx. Q sy oe ec ee oe & yr sy sy BO Obfeae obey stalin. a) Son 4 Dash 2. Use white spaces in ¢ to dencritne biamiks md 3. Ensure use of proper greptnce tunctom for rebewent obpect 4 Polipw safety prectsces. Result (Output of the Program) Practical Related Questions Note: Below given are few sample questions Sor reference. Teacher must design more such questions so as to ensure the achievement of identified CO. ote: Use Point VIII to X and XIII to XV for all relevant programming exercise use blank pages provided or attach more pages if needed.) ., Write the transformation matrix for 2D Translation. . Write the transformation matrix for 2D Scaling. . What does scaling transformation do? . }. Whether size of object remains same or changed in case of translation? (Space for Answers) Attempt Q1. And teacher shall allot Q. 2/Q.3 from the following: ont Use Point VIII to X and XIII to XV for all relevant programming exercise use lank pages provided or attach more pages if needed.) 1 Translate the polygon with co-ordinates A(2,5),B(7,10) and ©(10,2) by 3 units in x direction and 4 units in y direction. ; 2. Scale the polygon with co-ordinates A(2,5),B(7,10) and C(10,2) by 2 units in x direction and 2 units in y direction. 3. Give a 3x3 homogeneous co-ordinate transformation matrix for each of the i. Shift the image to the right 3 units ii, Shift the image up 2 units iii, Move the image down ¥% unit and right 1 unit iv. Move the image down 2/3 unit and left 4 units. 4. Find the transformation matrix that transforms the given square ABCD to half its size with center still remaining at the same position. The co-ordinates of the square are : A(1,1),BG,1),CG,3) and D(1,3) and center at (2,2).Also find the resultant co- ordinates of square. wr 21| Sine sind) on pr=P.R rotation matrix andi represented af ~ where Ris the . pe sind a | nae 098 lockwise or counterclockwise) be positive and negative (ie. cl tation matrix. However, for angle, we can use the sbove pe cos(—8) = |-sin(-#) cos(—9) i | ¢ cos(—8) = cos0 and sin(—8) = _sin8) angle @ about the origin 0 = ECS O= YSIAG yey sex YSin® ul As per batch Windows XP/Windows size 7/LINUX version 5.0 or later Turbo C/C++ Version 3.0 or later with DOSBOX xi. Precautions ‘ ‘ 1, Ensure that all C statements must end with a semicolon (;). 2. asiphite spaces in to describe blanks and tabs 3, Ensure use of proper graphies function for relevant object. ‘4. Follow safety/ethical practices. xill. Resources used Specification Tnre\(R) Cove 69 Ram UGes ge Toxo at Pinky XVI. Practical Related Questions ee” given a few sample questions for reference. Teacher must design Geert Xa i i se omnis fend ong it all ae programming exercise use 1.Write the transformation i q vation matrix for i 2. Write rotation matrix for a ganas. sera 60 Computer Graphics (22318) | (Space for Answers) ym the following: _ XVII. Exercise ‘Attempt QI. And teacher ee ant Q. 2/Q.3 fro lote: Use Point ‘Vill to X and to XV for all relevant programming exercise use Croke pages provide oF A pages if f needed.) Jewise by a0 angle of 45°. Find the rotation 1. Apoint (4, 3) is rotated sonia matrix and the resultant point. 2, Perform a counterclockwise 4 45° rotation of triangle A 2,3),B, 5.649) about point (11). 3, Find a transformation triangle A(1,0)B0, 1,C(1) by ne unit in X and y direction. i, Rotating 45°about < origin and then translating © direction and then rox ii. ‘Translating one ¢ unit in x an 4. Consider the square A\ anticlockwise direction. ying 45°about the origin (Space for Answers) Computer Graphics (22318) a oS im ee an, ordi inat xl=x and Yl=ysah 2 tine y-yref is xl=x+shx(y- ref) ang Input xen Lis ce line xexref is x1=x spear related 10 he shearing Yate ober afer 8) For Reflection -: be performed ed about x axis and y axis. Step A Reflection ca The transformed coordinates are x1=a and , Yisy 2 Rl a Te transformed coordinates are x1=x ai 3 after reflection a. 2%, a Sherxy , sharing for y axis Ys eas mye He, smth y m\> sh & et o bout Nem O'S, at oe Athldion che i ads Mem © « ay rs obpc = re aeh ator ae les Displouy obeck al ie S ec | cis oe he | Soe eee | totes Bice Ham & 4iey as Sere le =e ee eee ee ee XL Resources required j ee | Quantity Remarks Computer (13-15 preferable), RAM minimum 2 GB and ‘onwards but not limited to ‘As per batch Forall | Windows XP/Windows size Experiments | LINUX version 5.0 or later ae 1. Ensure that all C statements must end with a semicolon (;). 2 se white spaces in cto describe blanks and tabs. ; 3. Ensure use of proper graphics function for relevant object. 4. Follow safety practices. ‘Name of Resource Specification System Rg Ram -~U4G with broad specifications Toreh CRY core | ao Software Norsbol4 XVI. Practical Related Questions Note: Below given are few sample questions for reference. Teacher must design more such questions so as to ensure the achievement of ‘identified CO. (Note: Use Point VIII to X and XIII to XV for all relevant programming exercise use blank pages provided or attach more pages if needed.) 1. Write the transformation matrix for 2D Reflection. 2, Write the transformation matrix for 2D Shear, 3. Differentiate between X-shear and Y-shear, 4, Define Reflection and Shearing. ‘State Board of Technical Education (Space for Answers) Attempt QI. And teacher shall allot Q. 1/Q.2 from the following: (Note: Use Point VIII to X and XIII to XV. for all relevant programming exercise use blank pages provided or attach more pages if needed.) 1. A point (4, 3) is rotated counterclockwise by an anglé of 45°. Find the rotation matrix and the resultant point. Apply the Shearing transformation to square with ‘A(0,0),B(1,0),C(1,1) and D(0,1) as given below : i. Shear parameter value of 0.5 relative to the line Yref= -1; ii. Shear parameter value of 0.5 relative to the line Xref= -1; 2. Apply shearing transformation to square with A(0,0),B(1,0),C(1,1) and D(O,1).1f Sh, =0.5 then find the resultant co-ordinates. (Space for Answers) i) Z-Axis Rotation Z-axis rotation is identical to the 2D case: x'=x*cos 0 - y*sin @ y' = x*sin 8 + y*cos 0 Zaz ii) X-Axis Rotation X-axis rotation looks like Z-axis rotation if replace: Y'=y*cos 0 - z*sin 0 z'= y*sin 6 + z*cos 6 x=ex iti) Y-Axis Rotation Y-axis rotation looks like Z-axis rotation if replace: z= z*cos 0 - x*sin @ x'= z*sin 0+ x*cos 0 ey ©) Display the object after rotation ‘Step 4: Stop the Program. VIM. Algorithm 4) Stat @ Inpe the cw-ordinores © for Rotator 2 @ Enten- gotatton angle 6 : @ Perform rotation “abovt each cai’s ‘ A800, z-axis Rot 3 2 e) 2 m= WSO -Y = S00 ys m= Sin® xy < 0 Zam 2) W- Axis Rotatdo Yi Ys wsO— 2 =Sin® zie y «6inG@ + 2.2 Cos 7c J gq y- AxKcrs Rotedion 2 2. ms O$O-X=5n0 x1 ~ t §SINO. + X= (os o ah ey : : @ Display tne object alley aotation ny eetor 5 Maharashtra State Board of Technical Education rm i 3) i o's aoe mt pee ley = ~ ORday 4 he voices Obpck Stop Quantity AS per batch TILINUX version $:0 or later a Turbo C/OH Version 3.0 oF later with DOSBOX ‘A, Ensure that all C statements must end with a semicolon G). 2 Use white spaces in c to describe blanks and tabs, . Ensure use of proper graphics function for relevant object. 4. Follow safety/ethical Practices. Specification aa tid PS WA Gen: 84m Ram, srt GBkom Cae _ Note: Below given are few sample questions for reference. Teacher must design such questions So as to ensure the achievement of identified CO. a (Ne # Use Point VIII to X and XIII to XV for all relevant programming exercise Pages provided or attach more pages if needed.) ‘transformation matrix for 3D Rotation about Z-axis. fe Ey ee ae 3, Write the transformation matrix for 3D Rotation about Y-axis. (Space for Answers) c ees If both codes are 0000,(bitwise OR of the codes yields 0000 ) jing completely inside the window: pass the endpoints to the draw routine. Hes _If both codes have a 1 in the same bit position (bitwise AND of the is not 0000), the line lies outside the window. It can be trivially rejected, “'*S 3. If @ line cannot be trivially accepted or rejected, at least one of the two eng, st Ue outside the window and the line segment crosses a window edge “1h ust be clipped at the window edge before being passed to the drawing 4, Examine one of the endpoints, sa P; 's 4-bit i y P:=(X1, Yi). Read Py's 4-bit cod: ‘ stead ae 1=(X1,Y9). 1'8 4-bit code in order: Lefy. . When a set bit (I) is found, compute the intersection I of the c . \ ‘ : Otrespondin, window edge with the line from P; toP2, Replace Py with Land repeat 6 VIL. Algorithm @ :Gren atthe Soyer wren trdpdar AComy) & P(e ,42) @ :Compore the U-bet Codes for Fach Enctprint $F boty codes ox Coco, Hr Line Leer Ovidde te window. TF can be AniviodLy aefectedt - @: Comporea TF % Une Cannot be tami oll Cuecepked ov yojected at Leoark one of thr bux Ena POLNE most We oporsicla tre window’ A tes Line. muse be chpped ak the Undo Edy, befor POG Parse ty te drawing moutine ‘ > Baming One of tr Endpéin's Savy RCo, 4s) Read R's UYbr Code in Od +>. Rat Bottor “to top. 2 S Wlhen a Sek BEC!) Ts frond: Compute tre Hon of sn corraes pon ding window pom the Ud f20 2 Po eplow win & 8 prvcesiae nrersection of tra State Board of Technica! Education “computer Graphs (22318) 1x. Flow Chart | Eolchtur oped] Banc wi nolo — Quantity | Remarks] | As per | Windows XP/Windows batch size 7/LINUX version 5.0 or For all | Experiments | Turbo C/C++ Version 3.0 or later with DOSBOX XII. Precautions ’ 1. Ensure that all C statements must end with a semicolon (;).” 2. Use white spaces in ¢ to describe blanks and tabs. 3. Ensure use of proper graphics function for relevant object. 4. Follow safety/ethical practices. XIII. Resources used S.No. | Name of Resource Specification aaa 1 Computer System Sustem with broad specifications | ~J Pore fect 2: 3 "| Software Any other resource used Towbo C*T XIV. Result (Output of the Program) ii. How to calculate intersection points of a line if} line is partially visible. State Board of Technical Education 96 Computer Graphics (22318) iii. Give 3 possib : algorithm. le conditions to clip line using Cohen Sutherland line clipping (Space for Answers) d teacher shall allot Q. 2/Q.3 from the following: a ‘VIII to X and XIII to XV for all relevant programming exercise use or attach more pages if needed.) and determine clipping categories of each ‘Attempt Q1. am (Note: Use Point blank pages provided 1. Write four bit code for following lines line. 1. Hilbert 4 2. It takes ‘inal Ee PeCUsivoly de ous. Fone Smotles, Htbeat Cures 2 connacks thom with Unos, © :- op ee ee eR eee IX. _ Flow Chart Greet) Ulex Subanuing — clans Ay Lakes 8 Pormematees tha clap of meson & dor 2ky volues gives 2 2 aeckon (er oon Fo, 3 re aeurrsweliy Ames four Smaltor Liber t Cndves XID. Resources useg Be ics (22318) ‘ Name of Resource cw buter System With broad specifications Software ~ Wh 27 BGR RAY S12 @BROY “Nowbo Cr Any other Tesource used XIV. Result (Output of the Program) Ms XVI. Practical Related Questions Note: Below given are few sample questions for reference. Teacher must design more such questions so as to ensure the achievement of identified CO. (Note: Use Point VIII to X and XIII to XV for all relevant programming exercise use blank pages provided or attach more pages if needed.) i. Define Curve. ii. Write topological and fractal dimension of Hilbert’s curve. (Space for Answers) ot fe ad Procedure: Koch curve: : The Koch is a simple fractal that creates a pretty snowflake-like object. The curve f : iteration algorithm is very simple: 1. Start with a straight line: et 2, Trisect the line into three segments: ey 3. Form an equilateral triangle rising out of the middle segment pa No 4, Repeat, with newly formed segmient. Ifyou start with an equilateral triangle instead of a line, you get the lovely image shown at the top of the article after a few iterations. Bezier Curve: To each set of four points Po, Pi, P2, Properties: 1. It starts at Po and ends at P3. 2. When it starts from Pp it heads dire: , coming from the direction of P,. . The entire curve is contained in the juadrilateral whose c i ae q se comers are the four given Pswe associate a curve with the following tly towards P;, and when it arrives at P; it is VEIL. Algorithm © Seat ‘ G Dedoee 2s rikiotize c ICAL, 8) 26 (N20 than Ling Geb , Yo \2b); Wag loe Liye 20); Une Carat Ya ad); . (y %WVJ=0)+hen zoe

You might also like