RAY TRACING EXERCISES FOR WEEK 2
week2-1

Given the vectors a = <2, -3> and b = <-1, 4>.

  • Sketch the vectors.
  • Find the sum of the vectors and sketch this vector.
  • Find the difference, b - a, and sketch this vector.
  • Give a linear combination of the two vectors.
  • Give an affine linear combination of the vectors.
  • Give a convex affine linear combination of the vectors.

 

week2-2

Find the magnitude of these vectors:

  1. <1, -2, 0.5>
  2. <8, 6>
  3. <-4, 3>

 

week2-3

Normalize these vectors:

  1. <1, -2, 0.5>
  2. <8, 6>
  3. <-4, 3>

 

week2-4

Find the dot product of these vectors:

  1. <1, -2, 0.5> and <0, -4, 2>
  2. <8, 6> and <-2, 3>
  3. <-4, 3> and <-1, -1>

 

week2-5

Assume you have a ray that starts at the point (5,15) and has direction <2, -3>. Thus r(t) = s + ct, where

  • r(t) is the ray
  • s is the starting point
  • c is the direction
  1. sketch the ray
  2. If the ray intersects the x-axis, find when (t_hit) and where (P(t_hit), and sketch.
  3. If the ray intersects the y-axis, find when (t_hit) and where (P(t_hit), and sketch.
  4. If the ray intersects the line y=7, find when (t_hit) and where (P(t_hit), and sketch.
  5. If the ray intersects the line passing through the points (4,4) and (20,10), find when (t_hit) and where (P(t_hit), and sketch.
  6. If the ray intersects the circle whose center is (10,10) and whose radius is 4, find when (t_hit) and where (P(t_hit), and sketch.

 

week2-6

Assume you have a ray that starts at the point (-3,-5,0) and has direction <2,0.4,0>. Does the ray intersect the generic sphere (centered about the origin with radius of 1)? If so, when and where? Sketch the ray and sphere.