1
CS 33400
Fall 2010
Voicu Popescu
Due: Tuesday September 7 at 6:00am
Assignment 1—Vectors, matrices, transformations
In a nutshell
Implement a 3D vector class and a 3x3 matrix class. Illustrate your classes by rotating a
point about an arbitrary axis.
Details
1.
3D vector class
•
Stores 3 floats.
•
Constructor from 3 floats.
•
Read/write access to elements with square brackets operator.
•
Stream I/O using << and >> operators.
•
Normalization.
•
Length.
•
Dot product (choose operator).
•
Cross product (choose operator).
•
Multiplication/division with scalar (use operator).
•
Addition/subtraction with another vector (use operators).
•
Rotate point about arbitrary axis. Parameters are 2 points to define axis and a
scalar (float) to define the rotation angle in degrees.
•
Rotate vector about arbitrary axis.
2.
3x3 matrix class
•
Stores 3 3D vectors
•
Constructor: identity matrix.
•
Constructor: rotation about {x|y|z} axis alpha degrees.

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*