/***************************************************************************
 *            vector.h
 *
 *  Thu Jan 27 02:24:04 2005
 *  Copyright  2005  Peter Baldwin
 *  pgbaldwi@uwaterloo.ca
 ****************************************************************************/

#ifndef _VECTOR_H
#define _VECTOR_H

#include "common.h"

typedef struct {
	double x,y;
} vector;

extern vector VZERO;

//vector operations
vector vAdd(vector v1, vector v2);
vector vSubtract(vector v1, vector v2);
vector vScale(vector v, double factor);
vector vScaleNormal(vector v, vector normal, double factor);
vector vUnit(vector v);
double vDot(vector v1, vector v2);
double vMagnitude(vector v);
double vDistance(vector v1, vector v2);

bool vEqual(vector v1, vector v2);
vector vNew(double x, double y);

#endif /* _VECTOR_H */
