/* Computer Graphics, Assignment, Intersections
 * Filename ........ vectors.c
 * Description ..... Vector calculation help functions.
 * Date ............ 22.09.2010
 *
 * Student name .... Sander van Veen & Taddeus Kroes
 * Student email ... sandervv@gmail.com & taddeuskroes@hotmail.com
 * Collegekaart .... 6167969 & 6054129
 * Date ............ 22.09.2010
 */

#ifndef VECTORS_H
#define VECTORS_H

#define VECTOR_LENGTH(p) sqrt( p.x*p.x + p.y*p.y + p.z*p.z )

typedef struct vector
{
	GLfloat x, y, z;
}
vector;

vector createVector(GLfloat x, GLfloat y, GLfloat z);
vector normalizeVector(vector p);
vector addVectors(vector p1, vector p2);
vector substractVectors(vector p1, vector p2);
vector scalarMultiply(vector p, GLfloat scalar);
GLfloat dotProduct(vector p1, vector p2);
vector crossProduct(vector p1, vector p2);

#endif
