关键词 > CSE3541/5541

CSE3541/5541 (Summer 2022) Homework #3

发布时间:2022-07-23

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Homework #3

CSE3541/5541 (Summer 2022)

I.      Preparation

Study the course lecture notes before attempting this assignment. All questions can be answered from course material.

II.      Collaboration & Piazza

Please read the course policy on Academic Misconduct in the syllabus. You may discuss the problems with your classmates at a high level only. Though, you must formulate your own solution without any help from others or third party sources.

In your solution, you need to list with whom you have discussed for each problem (please do so in the first page).

Do not post any part of your solution or spoilers on Piazza.

III.      Guidelines

You will place your solution into a single PDF file named HW3_name_dotnumber.pdf (e.g., HW3_shareef_ 1.pdf).

It is highly suggested that you directly type your solutions and save them as a PDF file. If you write your solutions on paper and scan it you run the risk that the TA won’t be able   to read your solution. In this case the TA will not give credit for any portion that is not     readable.

IV.      Problems

NOTE: For each problem, please show all work and then clearly state your final    answer. Just writing a final answer (even if correct) with little to no work will         receive little to no credit. Credit will be based upon your work to arrive at the final answer.

0)  List with whom you have discussed the homework in any way. If you did not discuss  with anyone then write “No discussions” . Remember that all discussions must only be at a high level. Do not share your work or look at other student’s work. Do not use      third party sources.

1)  Refer to the lecture notes “Interpolation” . A color value is a single decimal number (scalar) that represents a grey level color in a greyscale in the range [0, 1], where    coloT = 0 is black and coloT = 1 is white.

a.   (15 points) Consider the following four points in the x-y Cartesian            coordinate system: P1  = (0,0),  P2  = (5,0), P3  = (0,5), and P4  = (5,5).   Let point P1 have coloT = 0.75, point P2 have coloT = 0.2, point P3 have coloT = 0.75, and point P4 have coloT = 0.5. Use Bilinear Interpolation  to compute the color at point (3,2). To receive full credit, clearly show  the formulae and steps used to compute the final answer, which is a    single decimal number.

b.   (20 points) The following four points in the x-y Cartesian coordinate         system define a polygon in clockwise order: P1  = (3, 1),  P2  = (2,6), P3  = (4,8), and P4  = (6,4). Let point P1 have coloT = 0. 1, point P2 have

coloT = 0.8, point P3 have coloT = 0.6, and point P4 have coloT = 0.3. Use Bilinear Interpolation to compute the color at the scanline y = 3 at  the point (4,3). To receive full credit, clearly show the formulae and  steps used to compute the final answer, which is a single decimal       number. Use parametric line equations to represent the polygon       edges. Use only those polygon edges that are required in the bilinear interpolation. I.e., you won’t use all polygon edges.

2)  (20 points) Derive the Lagrange polynomial (curve) definition for the following three control points in the x-y Cartesian coordinate system: P1  = (1,2),  P2  = (4,2), P3  =   (5, 1). To receive full credit, write the initial formula for each Li  (full equation)    and then plug in your values and simplify. Your final answer is a polynomial       equation.

3)  (20 points) Use the De Casteljau algorithm to compute the point at t = 0. 4 on a      polynomial curve defined with the following three control points in the x-y Cartesian coordinate system: P1  = (1,3),  P2  = (3,2), P3  = (6,5). To receive full credit,        clearly show each step of the algorithm. For each interpolation formula, write   the original formula first and then write the formula with plugged in values to   arrive at an interpolated point.

4)  (13 points) The Blending Function Form” of the Cubic Bezier is

p3 (t) = (1 − t)3 P0  + 3t(1 − t)2 P1  + 3t2 (1 − t)P2  + t3 P3

and the Matrix form” is

p3 (t) = [t3

−1

t2       t    1]     3

[   1

3

−6

3

0


−3

3

0

0


0(0) [ P(P)2(1)]

The matrix in the middle is the “coefficient matrix” . Starting from the Blending       Function Form”, derive the values in the “coefficient matrix” . To receive full credit, show each step of your derivation.

5)  (12 points) Consider an L-system (using Turtle graphics) with the following axiom and rule:

Axiom: F

Rule: F  F-F-

a)  What is the resulting expression after ONE application of the rule?

b)  What is the resulting expression after TWO applications of the rule?

c)  Using turtle graphics, create a drawing from applying the rule twice, i.e. part b above. Start the turtle to initially face NORTH, i.e. up, and use a turn angle of

90 degrees. Note that your turtle should be facing SOUTH at the finish.