/**
 * \file Line.h
 * \date 5.04.2004
 * \author Pavol Misik
 * Interface for the Line class.
 */


#ifndef COMMON_WORLD_LINE_H
#define COMMON_WORLD_LINE_H

#include "Common/World/Point.h"
#include "Common/World/Circle.h"

const float FLOAT_EPS = 0.001f;

/**
 * \class Line
 * \author Pavol Misik
 * \brief Priamka v implicitnom tvare ax+by+c=0
 */
class Line  
{
public:
	Line(float a, float b, float c);
	Line(const Point& p1, const Point& p2);
	virtual ~Line();

	void FromPoints(const Point& p1, const Point& p2);
	bool Intercept(const Line& line, Point& pos)const;
	int Intercept(const Circle& c, Point& pos1, Point& pos2)const;
	Line Perpendicular(const Point& pos)const;
	float DistanceToPoint(const Point& pos)const;
	Line Parallel(const Point &p)const;
protected:
	float GetY(float x) const;
protected:
	// Ax+By+C=0
	float fA;
	float fB;
	float fC;
};

#endif // COMMON_WORLD_LINE_H
