Computer Graphics
CSE 5280 Math Fundamentals



Math Fundamentals

References

Vectors

A vector is a directed line segment, characterized by its length and direction.

Vector Properties

Vectors have special arithmetic properties:

  1. If A is a vector, then -A is a vector with same length as A but pointing in the opposite direction.
  2. If A is a vector, the kA is a vector whose direction is the same as or opposite that of A, depending on the sign of the number k, and whose length is k times the length of A. This is an example of scalar multiplication.
  3. Two vectors can be added together to produce a third vector by using the parallelogram method or the head-to-tail method. This is an example of vector addition.

In the parallelogram method, vectors A and B are placed tail to tail. Their sum A + B is the vector determined by the diagonal of the parallelogram formed by the vectors A and B. In the head-to-tail method, the tail of B is placed at the head of A. The vector A + B is determined by the line segment pointing from the tail of A to the head of B. Both methods yield the same results, however the head-to-tail method is easier when adding multiple vectors together. See figure below.

The dot product

The dot product can be used to generate vectors whose length is 1, this is called normalizing a vector. To nomalize a vector v, we simply compute v´ = v / ||v||. The resulting vector has a length 1, and is called the unit vector.
Dot products can also be used to measure angles. The angle between the vectors v an w is

COS - ¹ ( v . w / ||v|| ||w|| )

Note that, if v and w are unit vectors, then the division is unnecessary. Dot product characteristics include the following:

Example:

Calculate the angle between the vectors a = 3i + 5j and b = 2i + j, shown the figure below:

		
			|| a || = (x1)² + (y1)²     || b || = (x2)² + (y2)²
				    = (3)² + (5)²              = (2)² + (1)²
				    = 9 + 25                   = 4 + 1
                  = SQRT(34)                 = SQRT(5)
             
             a . b = (x1 × x2) + (y1 × y2)
                   = (3 × 2) + (5 × 1)
                   = 6 + 5 = 11
                 ø = COS-¹ (11/( SQRT(34) × SQRT(5) ))
                 ø = COS-¹ (11/ SQRT(170)) 
                 ø = COS-¹ (11/13.038) = COS-¹(.84368) = 32.47