Digital Lighting: Homework #3

return to course


Functions!

Due: Tuesday, April 25, 10:30am

Graph each of the following functions (use paper and pencil) over the specified domain. Plot x along the x-axis and f(x) along the y-axis. Under each graph, write the range of the function over the specified domain. See the Regular Patterns section of RManNotes for definitions of step, smoothstep, and mod. Each problem is worth 5 points (4 points for the graph, 1 point for the range).

  1. f(x) = 2
    x domain: [0,1]
  2. f(x) = 2 * x - 1
    x domain: [0, 1]
  3. f(x) = (x + 1) * 0.5
    x domain: [-1, 1]
  4. f(x) = step(0.5, x)
    x domain: [0,1]
  5. f(x) = smoothstep(0.4, 0.5, x)
    x domain: [0,1]
  6. f(x) = smoothstep(0.1, 0.9, x)
    x domain: [0,1]
  7. f(x) = mod(x, 1.0)
    x domain: [0,4]
  8. f(x) = mod(x * 4, 1.0)
    x domain: [0,1]

Graph the two functions below (the first is easy) and answer the following question: what might the mod function be useful for? The graph for #1 is worth 2 points; the graph for #2 is worth 5; the answer to the question about mod is worth 3.

  1. f(x) = step(0.5, x)
    x domain: [0,1]
  2. f(x) = step(0.5, mod(x * 4, 1.0))
    x domain: [0,1]

Last updated: 4/23/97

Steve May (smay@cgrg.ohio-state.edu)