14.1 State whether each of the following is true or false. If false, explain why.

  1. The strokeStyle attribute specifies the line width. False. The strokeStyle attribute specifies the stroke color
  2. The bevel lineJoin gives the path square corners. False. The bevel lineJoin gives the path sloping corners
  3. canvas’s roundedRect method is used to build rounded rectangles. False. there is no roundedRect method in canvas.
  4. The fillRect method is used to specify a color or gradient. False, the fillRect method drase the color or gradient on the canvas, the fillStyle method specifies a color gradientt
  5. By default, the origin (0, 0) is located at the exact center of the monitor. False. (0,0) is on the upper left corner of the canvas.
  6. The restore method restores the context to its initial state. False. The restore method restores the context to its previous state.
  7. The canvas’s state includes its current style and transformations, which are maintained in a stack.True

14.2 Fill in the blanks in each of the following.

  1. The canvas element has two attributes width and height .
  2. When drawing a retangle, the strokeRect method specifies the path of the stroke in the format (x,y,w,h).
  3. The lineCap attribute has the possible values square, round,and butt.
  4. The closePath method draws a line from the last specified destination back to the point of the path's orgin.
  5. The bezierCurveTo method specifies the 3 points in the Bezier curve.
  6. The shawdowColor attribute specifies the coloar of the shadow.
  7. Arcs are portions of the circumference of a circle and are measured in radians.
  8. The save method is used to save the context's current state.

14.3 State whether each of the folloing is true or false. If false, explain why.

  1. The moveTo method sets the x- and y- coordinates of the paths' destination. False, the moveTo method sets the x and y coordinates to the path's origin.
  2. A square lineCap specifies that the line ends have edges perpendicular to the direction of the line and no additional cap. True
  3. A vertical gradient has different x-coordinates but the same y-coordinates. False, the x-coordinates have the same value while the the y-coordinates are different.
  4. In the canvas coordinate system, x values increase from left to right. True
  5. Bezier curves have a starting point, and ending point and a single point of inflection. False, the Bezier curves have two control points of inflection.

14.4 Fill in the blanks in each of the following:

  1. The beginPath method starts the path.
  2. The lineJoin attribute has three possible values bevel, round, and miter.
  3. The fillStyle attribute specifies the line color.
  4. The bevel lineJoin bevels the lines at an angle where they meet
  5. Each color stop in a gradient has a value between 0 (the start of the gradient) and 1(the end of the gradient)
  6. The textAlign attribute specifies the horizontal alignment of the text related to the x-coordiante of the text.
  7. The constant Math.pi is the JavaScript repesentation of the mathematical contant pie.