
///////////////////////////////////////////////////////////////////////////
//
// Jesse Doane
// edge.h
// April 2000
//
// edge ( line segment ) class with two intersection methods,
// one returns a boolean, the other returns the point at which two
// edged intersect, angle method returns angle formed at intersection 
// of two edges, and rotate method.
//
#ifndef EDGE
#define EDGE

#include <stdio.h>
#include <math.h>
#include <memory.h>
#include "q.h"
#include "gpdumb1.h"
#include "vertex.h"

Vertex* Gauss_Jordan_2( double eq1[], double eq2[] );

class Edge{

private:

	Vertex* v1;
	Vertex* v2;
	double  equation[3];
	bool    slope_dne;
	double  slope;
	double  y_intercept;

	unsigned char color;

public:

	Edge( void );
	Edge( float a, float b, float c, float d );
	Edge( Vertex*, Vertex* );

	void	SetColor( int c ){ color = c; }
	Vertex* V1( void ){ return v1; }
	Vertex* V2( void ){ return v2; }
	void	Equation( void );
	void	CopyEquation( double eq[] );
	
	void	Add( Vertex* );
	bool    bIntersection( Edge* );
	Vertex* vIntersection( Edge* );
	int		CheckBounds( void );
	void	Rotate( Vertex*, double );
	double	Angle( Edge* );
	void	Draw( unsigned char* );
};

////////////////////////////////////////////////////////////////////////

#endif