/////////////////////////////////////////////////////////////////////////
//
//	vertex.h 
//  Jesse Doane
//  April 2000
//
//	this class can be used for two-dimensional points, vertices, vectors	

#ifndef VERTEX
#define VERTEX

#include <memory.h>
#include <math.h>

#define PI 3.141592654

#define HIT_BOTTOM 0
#define HIT_TOP 1
#define HIT_LEFT 2
#define HIT_RIGHT 3

class Edge;
class Asteroid;

class Vertex{

	friend class Asteroid;
	friend class Edge;
	friend float TriArea( Vertex*, Vertex*, Vertex* );

protected:
	
	double x, y;

public:
	
	Vertex( void );
	Vertex( double xx, double yy ){ x = xx; y = yy; }
	Vertex( Vertex* );
	
	double X( void ) { return x; }
	double Y( void ) { return y; }

	int CheckBounds( void );
	
	// dot product
	double Dot( Vertex* );
	// magnitude of vector represented by this vertex
	double Norm( void );
	// subtract and add vertices
	void Sub( Vertex* );
	void Add( Vertex* );

	// rotate some angle about the origin
	void Rotate( double );
	// rotate some angle about a point
	void Rotate( Vertex*, double );
	
};

#endif