📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit the "Enter" key)
1,2,3,4,5,6,7,8,9,10q3
📗 Please report any bugs or mistakes on Piazza.
📗 Question 1
Question 2
📗 Question 3
Question 4
📗 Question 5
Question 6
📗 Question 7
Question 8
📗 Question 9
Question 10
📗 [1 points] Suppose print(...) behaves like console.log(...), what does the following block of code print?
function f(x) {
let y = x;
let g = function(z) {
print("A " + (y + z));
y = y + 1;
}
y = y + 2;
print("B " + y);
return g;
}
let a = f(??);
let b = f(??);
a(??);
b(??);
a(??);
Output:
Click to check: Incorrect.
📗 [1 points] A quadratic Bezier curve has its control points , , . If the curve is the same as a cubic Bezier curve, it has control points at . Click to draw the curve. If the red curve segment is on top of the black curve segment, then the answer is correct.
📗 [1 points] A Bezier curve with control points , , , is re-parameterized with an arc-length parameterization. The tangent at the beginning of the curve is . The tangent vector at the end of the curve is . Click to draw the tangent: if the color of the tangent is green, then it is correct.
📗 [1 points] Two transformations \(f\) and \(g\) are commutative if \(f\left(g\left(x\right)\right) = g\left(f\left(x\right)\right)\) for every \(x \in \mathbb{R}^{2}\). In the following table S is scaling, R is rotation, and T is translation, a, b, c, d > 0 are distinct constants.
Commutative
-
Not commutative
S(a, b), S(c, d)
S(a, a), R(c)
S(a, b), R(c)
S(a, a), T(c, d)
S(a, b), T(c, d)
R(a), R(b)
R(a), T(b, c)
T(a, b), T(c, d)
Click to check: Incorrect.
📗 [1 points] The function \(f\left(u\right) = \begin{bmatrix} \cos\left(u\right) \\ \sin\left(u\right) \end{bmatrix}\) is an arc-length parameterization over \(u \in \left[0, 1\right]\). Which of the following are also arc-length parameterizations over \(u \in \left[0, 1\right]\).
Arc-length
-
Not arc-length
Click to check: Incorrect.
📗 [1 points] A quadratic Bezier curve has its control points , , . A cubic Bezier curve is connected to the end of it with \(C\left(1\right)\) continuity. Give an example of the control points of the cubic curve segment: . Click to draw the curve. If the curve segment is green, then the answer is correct.
📗 [1 points] A cubic Bezier curve has its control points , , , . A quadratic Bezier curve is connected to the end of it with \(G\left(1\right)\) but not \(C\left(1\right)\) continuity. Give an example of the control points of the quadratic curve segment: . Click to draw the curve. If the curve segment is green, then the answer is correct.
📗 [1 points] Two cubic Bezier curves have their control points , , , and , , , . Another cubic Bezier curve is used to connect the two cubic curves with \(C\left(1\right)\) continuity. Give an example of the control points of the cubic curve segment: . Click to draw the curve. If the curve segment is green, then the answer is correct.
📗 [1 points] If the transformation with matrix is a rotation, what are valid values of \(a, b\) = . Use to test the operation on a square drawn at \(\begin{bmatrix} 0 \\ 0 \end{bmatrix}\).
📗 [1 points] Redefine the mat array so that the image on the left and the image on the right look the same.